summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-11-18 23:24:53 -0500
committerJohn Wiegley <johnw@newartisans.com>2009-11-18 23:25:28 -0500
commitae8b57f15785f0fbe300e7d6d2b709b4730556d1 (patch)
treeb0650b21331300e3e5eecf6185b70721b8f792b2 /src
parent56d6df6123d84abe408e16fcecd7a7600eb33055 (diff)
downloadfork-ledger-ae8b57f15785f0fbe300e7d6d2b709b4730556d1.tar.gz
fork-ledger-ae8b57f15785f0fbe300e7d6d2b709b4730556d1.tar.bz2
fork-ledger-ae8b57f15785f0fbe300e7d6d2b709b4730556d1.zip
Renamed bool controlling running total calculations
It used to be "account_wise", since it only happens for non-account-wise reports. Now it's called just "calc_running_total", so anyone can request it.
Diffstat (limited to 'src')
-rw-r--r--src/chain.cc2
-rw-r--r--src/filters.cc4
-rw-r--r--src/filters.h6
3 files changed, 6 insertions, 6 deletions
diff --git a/src/chain.cc b/src/chain.cc
index 479f9812..06bcdf27 100644
--- a/src/chain.cc
+++ b/src/chain.cc
@@ -95,7 +95,7 @@ post_handler_ptr chain_post_handlers(report_t& report,
// calc_posts computes the running total. When this appears will determine,
// for example, whether filtered posts are included or excluded from the
// running total.
- handler.reset(new calc_posts(handler, expr));
+ handler.reset(new calc_posts(handler, expr, ! for_accounts_report));
// filter_posts will only pass through posts matching the
// `secondary_predicate'.
diff --git a/src/filters.cc b/src/filters.cc
index ff5a9775..4c69dd78 100644
--- a/src/filters.cc
+++ b/src/filters.cc
@@ -217,7 +217,7 @@ void calc_posts::operator()(post_t& post)
if (last_post) {
assert(last_post->has_xdata());
- if (! account_wise)
+ if (calc_running_total)
xdata.total = last_post->xdata().total;
xdata.count = last_post->xdata().count + 1;
} else {
@@ -230,7 +230,7 @@ void calc_posts::operator()(post_t& post)
account_t * acct = post.reported_account();
acct->xdata().add_flags(ACCOUNT_EXT_VISITED);
- if (! account_wise)
+ if (calc_running_total)
add_or_set_value(xdata.total, xdata.visited_value);
item_handler<post_t>::operator()(post);
diff --git a/src/filters.h b/src/filters.h
index 57b3edd2..40119d6d 100644
--- a/src/filters.h
+++ b/src/filters.h
@@ -280,16 +280,16 @@ class calc_posts : public item_handler<post_t>
{
post_t * last_post;
expr_t& amount_expr;
- bool account_wise;
+ bool calc_running_total;
calc_posts();
public:
calc_posts(post_handler_ptr handler,
expr_t& _amount_expr,
- bool _account_wise = false)
+ bool _calc_running_total = false)
: item_handler<post_t>(handler), last_post(NULL),
- amount_expr(_amount_expr), account_wise(_account_wise) {
+ amount_expr(_amount_expr), calc_running_total(_calc_running_total) {
TRACE_CTOR(calc_posts, "post_handler_ptr, expr_t&, bool");
}
virtual ~calc_posts() {