summaryrefslogtreecommitdiff
path: root/format.h
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2004-08-09 17:32:20 -0400
committerJohn Wiegley <johnw@newartisans.com>2004-08-09 17:32:20 -0400
commit05b2cc46fdf6accd2ecbdc3c1ce86829bc7bfa68 (patch)
treeab61a5efdcdfe7bb73f346da5e45ac228d6458c0 /format.h
parent2dc822291f3ecef34eb0ef2920c395b0e056fbda (diff)
downloadfork-ledger-05b2cc46fdf6accd2ecbdc3c1ce86829bc7bfa68.tar.gz
fork-ledger-05b2cc46fdf6accd2ecbdc3c1ce86829bc7bfa68.tar.bz2
fork-ledger-05b2cc46fdf6accd2ecbdc3c1ce86829bc7bfa68.zip
fixed account display bug
Diffstat (limited to 'format.h')
-rw-r--r--format.h24
1 files changed, 16 insertions, 8 deletions
diff --git a/format.h b/format.h
index 65c111e1..66a7f7cf 100644
--- a/format.h
+++ b/format.h
@@ -204,9 +204,20 @@ class format_account
: output_stream(_output_stream), format(_format),
disp_pred_functor(display_predicate) {}
- void operator()(account_t * account,
- const unsigned int max_depth = 1,
- const bool report_top = false) const;
+ static bool disp_subaccounts_p(const account_t * account,
+ const item_predicate<account_t>&
+ disp_pred_functor,
+ const account_t *& to_show);
+ static bool display_account(const account_t * account,
+ const item_predicate<account_t>&
+ disp_pred_functor);
+
+ void operator()(const account_t * account) const {
+ if (display_account(account, disp_pred_functor)) {
+ format.format_elements(output_stream, details_t(account));
+ account->dflags |= ACCOUNT_DISPLAYED;
+ }
+ }
};
@@ -241,11 +252,8 @@ class format_equity
next_lines_format.format_elements(output_stream, details_t(&summary));
}
- void operator()(account_t * account,
- const unsigned int max_depth = 1,
- const bool report_top = false) const {
- if ((report_top || account->parent != NULL) &&
- disp_pred_functor(account)) {
+ void operator()(const account_t * account) const {
+ if (format_account::display_account(account, disp_pred_functor)) {
next_lines_format.format_elements(output_stream, details_t(account));
account->dflags |= ACCOUNT_DISPLAYED;
total += account->value.quantity;