summaryrefslogtreecommitdiff
path: root/src/filters.h
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2015-08-04 14:55:41 -0700
committerJohn Wiegley <johnw@newartisans.com>2015-08-04 14:55:41 -0700
commit81b14e471a1b2635bab280d589ba9f3eb46ce502 (patch)
treeae8d64d42ac2f20f83e459b237f19d6f967c6f02 /src/filters.h
parenta24910b3740b572db15fda4bd574222090e16d79 (diff)
parent977e33d39e2c896ac632f84230139af8da189b9b (diff)
downloadledger-81b14e471a1b2635bab280d589ba9f3eb46ce502.tar.gz
ledger-81b14e471a1b2635bab280d589ba9f3eb46ce502.tar.bz2
ledger-81b14e471a1b2635bab280d589ba9f3eb46ce502.zip
Merge remote-tracking branch 'origin/master' into next
Diffstat (limited to 'src/filters.h')
-rw-r--r--src/filters.h13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/filters.h b/src/filters.h
index e3dc19d8..1404b38e 100644
--- a/src/filters.h
+++ b/src/filters.h
@@ -421,9 +421,6 @@ public:
class collapse_posts : public item_handler<post_t>
{
-
- typedef std::map<string,value_t> totals_map;
-
expr_t& amount_expr;
predicate_t display_predicate;
predicate_t only_predicate;
@@ -432,7 +429,7 @@ class collapse_posts : public item_handler<post_t>
xact_t * last_xact;
post_t * last_post;
temporaries_t temps;
- totals_map totals;
+ account_t * totals_account;
bool only_collapse_if_zero;
std::list<post_t *> component_posts;
report_t& report;
@@ -451,13 +448,17 @@ public:
only_predicate(_only_predicate), count(0),
last_xact(NULL), last_post(NULL),
only_collapse_if_zero(_only_collapse_if_zero), report(_report) {
+ create_accounts();
TRACE_CTOR(collapse_posts, "post_handler_ptr, ...");
}
virtual ~collapse_posts() {
TRACE_DTOR(collapse_posts);
handler.reset();
}
- value_t& find_totals(account_t* account);
+
+ void create_accounts() {
+ totals_account = &temps.create_account(_("<Total>"));
+ }
virtual void flush() {
report_subtotal();
@@ -479,7 +480,7 @@ public:
last_post = NULL;
temps.clear();
- totals.clear();
+ create_accounts();
component_posts.clear();
item_handler<post_t>::clear();