diff options
author | John Wiegley <johnw@newartisans.com> | 2004-08-09 17:32:20 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2004-08-09 17:32:20 -0400 |
commit | 05b2cc46fdf6accd2ecbdc3c1ce86829bc7bfa68 (patch) | |
tree | ab61a5efdcdfe7bb73f346da5e45ac228d6458c0 /format.h | |
parent | 2dc822291f3ecef34eb0ef2920c395b0e056fbda (diff) | |
download | fork-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.h | 24 |
1 files changed, 16 insertions, 8 deletions
@@ -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; |