summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2011-07-17 16:25:05 -0500
committerJohn Wiegley <johnw@newartisans.com>2011-07-17 16:25:05 -0500
commitd0dfff62a6a3a685f19a5bed8716f7b661dc8c60 (patch)
tree2fb3d6cf621f0dc708dd41dc94107c5283c17959
parent65b3a778e2abb24e40945c1e3b4a9081c6a55ecd (diff)
downloadfork-ledger-d0dfff62a6a3a685f19a5bed8716f7b661dc8c60.tar.gz
fork-ledger-d0dfff62a6a3a685f19a5bed8716f7b661dc8c60.tar.bz2
fork-ledger-d0dfff62a6a3a685f19a5bed8716f7b661dc8c60.zip
Changed how some of the filters are constructed
-rw-r--r--src/filters.cc23
-rw-r--r--src/filters.h4
2 files changed, 12 insertions, 15 deletions
diff --git a/src/filters.cc b/src/filters.cc
index 686bef3f..27227ee9 100644
--- a/src/filters.cc
+++ b/src/filters.cc
@@ -524,14 +524,11 @@ display_filter_posts::display_filter_posts(post_handler_ptr handler,
report_t& _report,
bool _show_rounding)
: item_handler<post_t>(handler), report(_report),
+ display_amount_expr(report.HANDLER(display_amount_).expr),
+ display_total_expr(report.HANDLER(display_total_).expr),
show_rounding(_show_rounding)
{
- TRACE_CTOR(display_filter_posts,
- "post_handler_ptr, report_t&, account_t&, bool");
-
- display_amount_expr = report.HANDLER(display_amount_).expr;
- display_total_expr = report.HANDLER(display_total_).expr;
-
+ TRACE_CTOR(display_filter_posts, "post_handler_ptr, report_t&, bool");
create_accounts();
}
@@ -607,17 +604,17 @@ changed_value_posts::changed_value_posts
bool _show_unrealized,
display_filter_posts * _display_filter)
: item_handler<post_t>(handler), report(_report),
+ total_expr(report.HANDLED(revalued_total_) ?
+ report.HANDLER(revalued_total_).expr :
+ report.HANDLER(display_total_).expr),
+ display_total_expr(report.HANDLER(display_total_).expr),
+ changed_values_only(report.HANDLED(revalued_only)),
for_accounts_report(_for_accounts_report),
show_unrealized(_show_unrealized), last_post(NULL),
display_filter(_display_filter)
{
- TRACE_CTOR(changed_value_posts, "post_handler_ptr, report_t&, bool");
-
- total_expr = (report.HANDLED(revalued_total_) ?
- report.HANDLER(revalued_total_).expr :
- report.HANDLER(display_total_).expr);
- display_total_expr = report.HANDLER(display_total_).expr;
- changed_values_only = report.HANDLED(revalued_only);
+ TRACE_CTOR(changed_value_posts,
+ "post_handler_ptr, report_t&, bool, bool, display_filter_posts *");
string gains_equity_account_name;
if (report.HANDLED(unrealized_gains_))
diff --git a/src/filters.h b/src/filters.h
index 227245fb..2fcf0961 100644
--- a/src/filters.h
+++ b/src/filters.h
@@ -506,9 +506,9 @@ class display_filter_posts : public item_handler<post_t>
// This filter requires that calc_posts be used at some point
// later in the chain.
+ report_t& report;
expr_t display_amount_expr;
expr_t display_total_expr;
- report_t& report;
bool show_rounding;
value_t last_display_total;
temporaries_t temps;
@@ -554,9 +554,9 @@ class changed_value_posts : public item_handler<post_t>
// This filter requires that calc_posts be used at some point
// later in the chain.
+ report_t& report;
expr_t total_expr;
expr_t display_total_expr;
- report_t& report;
bool changed_values_only;
bool for_accounts_report;
bool show_unrealized;