From 18879bbe85cdef7a60d0692e17b9c835c81e77fc Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Sat, 18 Sep 2004 02:33:51 -0400 Subject: some changes in the way formatting strings are handled; for simplicity --- textual.cc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'textual.cc') diff --git a/textual.cc b/textual.cc index 57cb0089..e95d0eff 100644 --- a/textual.cc +++ b/textual.cc @@ -152,7 +152,7 @@ bool finalize_entry(entry_t * entry) value_t balance; - bool first = true; + bool no_amounts = true; for (transactions_list::const_iterator x = entry->transactions.begin(); x != entry->transactions.end(); x++) @@ -160,15 +160,19 @@ bool finalize_entry(entry_t * entry) ((*x)->flags & TRANSACTION_BALANCE)) { amount_t * p = (*x)->cost ? (*x)->cost : &(*x)->amount; if (*p) { - if (first) { + if (no_amounts) { balance = *p; - first = false; + no_amounts = false; } else { balance += *p; } } } + // If it's a null entry, then let the user have their fun + if (no_amounts) + return true; + // If one transaction of a two-line transaction is of a different // commodity than the others, and it has no per-unit price, // determine its price by dividing the unit count into the value of -- cgit v1.2.3