From 6e6246c927ab0d39dfd65f20e51c3f1b036c8ea9 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Mon, 9 Aug 2004 17:38:05 -0400 Subject: more fixes --- format.h | 5 +++++ main.cc | 9 +++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/format.h b/format.h index 66a7f7cf..9828c5e7 100644 --- a/format.h +++ b/format.h @@ -208,6 +208,11 @@ class format_account const item_predicate& disp_pred_functor, const account_t *& to_show); + static bool disp_subaccounts_p(const account_t * account) { + const account_t * temp; + return disp_subaccounts_p(account, item_predicate(NULL), temp); + } + static bool display_account(const account_t * account, const item_predicate& disp_pred_functor); diff --git a/main.cc b/main.cc index 35dfd860..5d105cb3 100644 --- a/main.cc +++ b/main.cc @@ -651,10 +651,11 @@ int main(int argc, char * argv[]) walk_accounts(journal->master, formatter, predicate.get(), xact_display_flags, show_subtotals, sort_order.get()); - std::string end_format = "--------------------\n"; - format.reset(end_format + f); - format_account(std::cout, format, - display_predicate.get())(journal->master); + if (format_account::disp_subaccounts_p(journal->master)) { + std::string end_format = "--------------------\n"; + format.reset(end_format + f); + format.format_elements(std::cout, details_t(journal->master)); + } } else if (command == "E") { format_t format(first_line_format); -- cgit v1.2.3