From 69de980aebf83e83971eb2b791e8676a0141f00a Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Tue, 4 Aug 2015 14:54:06 -0700 Subject: Revert "--depth for register" --- src/filters.cc | 33 +++++++-------------------------- 1 file changed, 7 insertions(+), 26 deletions(-) (limited to 'src/filters.cc') diff --git a/src/filters.cc b/src/filters.cc index fd30c966..2f97a0e5 100644 --- a/src/filters.cc +++ b/src/filters.cc @@ -448,20 +448,16 @@ void collapse_posts::report_subtotal() DEBUG("filters.collapse", "Pseudo-xact date = " << *xact._date); DEBUG("filters.collapse", "earliest date = " << earliest_date); DEBUG("filters.collapse", "latest date = " << latest_date); - - foreach (totals_map::value_type& pat, totals) { - handle_value(/* value= */ pat.second, - /* account= */ &temps.create_account(pat.first), - /* xact= */ &xact, - /* temps= */ temps, - /* handler= */ handler, - /* date= */ latest_date, - /* act_date_p= */ false); - } + handle_value(/* value= */ subtotal, + /* account= */ totals_account, + /* xact= */ &xact, + /* temps= */ temps, + /* handler= */ handler, + /* date= */ latest_date, + /* act_date_p= */ false); } - totals.clear(); component_posts.clear(); last_xact = NULL; @@ -470,20 +466,6 @@ void collapse_posts::report_subtotal() count = 0; } -value_t& collapse_posts::find_totals(account_t* account) -{ - unsigned short depth=3; - - if(depth==0) - return totals[_("")]; - - if(account->depth==depth) - return totals[account->fullname()]; - - //else recurse - return find_totals(account->parent); -} - void collapse_posts::operator()(post_t& post) { // If we've reached a new xact, report on the subtotal @@ -493,7 +475,6 @@ void collapse_posts::operator()(post_t& post) report_subtotal(); post.add_to_value(subtotal, amount_expr); - post.add_to_value(find_totals(post.account), amount_expr); component_posts.push_back(&post); -- cgit v1.2.3