diff options
author | John Wiegley <johnw@newartisans.com> | 2004-08-11 23:24:49 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2004-08-11 23:24:49 -0400 |
commit | c6f19a98d3a0af82508258765a635a7269667ba0 (patch) | |
tree | df3efc76ed29eb1fad4b9d1afbf2a0e19fe42b3c /main.cc | |
parent | 0cf1d8fe695ce570b9171c9e0eae6701a09b610b (diff) | |
download | fork-ledger-c6f19a98d3a0af82508258765a635a7269667ba0.tar.gz fork-ledger-c6f19a98d3a0af82508258765a635a7269667ba0.tar.bz2 fork-ledger-c6f19a98d3a0af82508258765a635a7269667ba0.zip |
cleanup
Diffstat (limited to 'main.cc')
-rw-r--r-- | main.cc | 23 |
1 files changed, 11 insertions, 12 deletions
@@ -590,18 +590,14 @@ int main(int argc, char * argv[]) if (command == "b") { std::auto_ptr<item_handler<transaction_t> > formatter; - formatter.reset(new add_to_account_value); if (show_related) formatter.reset(new related_transactions(formatter.release(), show_all_related)); - formatter.reset(new filter_transactions(formatter.release(), - predicate)); - + formatter.reset(new filter_transactions(formatter.release(), predicate)); walk_entries(journal->entries, *formatter.get()); format_account acct_formatter(std::cout, format, display_predicate); - if (show_subtotals) sum_accounts(journal->master); walk_accounts(journal->master, acct_formatter, sort_order.get()); @@ -613,11 +609,12 @@ int main(int argc, char * argv[]) } } else if (command == "E") { - add_to_account_value formatter; - walk_entries(journal->entries, formatter); + std::auto_ptr<item_handler<transaction_t> > formatter; + formatter.reset(new add_to_account_value); + formatter.reset(new filter_transactions(formatter.release(), predicate)); + walk_entries(journal->entries, *formatter.get()); - format_equity acct_formatter(std::cout, format, nformat, - display_predicate); + format_equity acct_formatter(std::cout, format, nformat, display_predicate); sum_accounts(journal->master); walk_accounts(journal->master, acct_formatter, sort_order.get()); } @@ -693,12 +690,14 @@ int main(int argc, char * argv[]) // Once the filters are chained, walk `journal's entries and start // feeding each transaction that matches `predicate' to the chain. - walk_entries(journal->entries.begin(), journal->entries.end(), - *formatter.get()); + walk_entries(journal->entries, *formatter.get()); #ifdef DEBUG_ENABLED + // The transaction display flags (dflags) are not recorded in the + // binary cache, and only need to be cleared if the transactions + // are to be displayed a second time. clear_display_flags cleanup; - walk_entries(journal->entries.begin(), journal->entries.end(), cleanup); + walk_entries(journal->entries, cleanup); #endif } |