diff options
author | Rahix <rahix@rahix.de> | 2020-05-12 23:25:26 +0200 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2020-07-21 14:50:01 -0700 |
commit | 81e107645ebfcb31c285ce8b2a4ea0cd922174f8 (patch) | |
tree | 05bd65798136f93fd11930d760e1f4fcd6594ed2 /src | |
parent | 1e3ec9b81008d0b87524db567017d60e24f6601c (diff) | |
download | fork-ledger-81e107645ebfcb31c285ce8b2a4ea0cd922174f8.tar.gz fork-ledger-81e107645ebfcb31c285ce8b2a4ea0cd922174f8.tar.bz2 fork-ledger-81e107645ebfcb31c285ce8b2a4ea0cd922174f8.zip |
collapse_posts: Fix some postings getting lost when collapsing
Because the only_predicate and display_predicate are applied to the
original posts, not the collapsed ones, they sometimes yield wrong
results leading to entire transactions getting dropped erroneously.
As this code is only relevant to depth == 0 collapsing (that is, the old
behavior), only follow the displayed_count == 1 code-path when the depth
is 0.
Diffstat (limited to 'src')
-rw-r--r-- | src/filters.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/filters.cc b/src/filters.cc index 574aac3b..67b6d35a 100644 --- a/src/filters.cc +++ b/src/filters.cc @@ -420,7 +420,7 @@ void collapse_posts::report_subtotal() displayed_count++; } - if (displayed_count == 1) { + if (collapse_depth == 0 && displayed_count == 1) { item_handler<post_t>::operator()(*last_post); } else if (only_collapse_if_zero && ! subtotal.is_zero()) { |