From 3c7b8442c20f9a86e7077dc8049d97d1f2b33885 Mon Sep 17 00:00:00 2001 From: Rahix Date: Tue, 12 May 2020 23:00:24 +0200 Subject: collapse_posts: Use the existing accounts instead of temps The temps will not have correct depth information attached which means a display predicate involving `depth` will most likely lead to wrong results. --- src/filters.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/filters.cc') diff --git a/src/filters.cc b/src/filters.cc index 67b6d35a..6db8af80 100644 --- a/src/filters.cc +++ b/src/filters.cc @@ -451,7 +451,7 @@ void collapse_posts::report_subtotal() foreach (totals_map::value_type& pat, totals) { handle_value(/* value= */ pat.second, - /* account= */ &temps.create_account(pat.first), + /* account= */ pat.first, /* xact= */ &xact, /* temps= */ temps, /* handler= */ handler, @@ -473,10 +473,10 @@ void collapse_posts::report_subtotal() value_t& collapse_posts::find_totals(account_t* account) { if (collapse_depth == 0) - return totals[_("")]; + return totals[global_totals_account]; if (account->depth <= collapse_depth) - return totals[account->fullname()]; + return totals[account]; //else recurse return find_totals(account->parent); -- cgit v1.2.3