From 151a8d87ee299b54da262346471aa71a729a6eb2 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Mon, 26 Oct 2009 18:52:26 -0400 Subject: Fixed sorting in bal reports when --flat is used Note that sorting on the "total" is not the same thing as sorting on the "display_total" when multiple commodities are in use and the -X flag is selected! One should always sort on display_total, since that's the value which is shown in the report. 'T' is a synonym for display_total. --- src/iterators.h | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'src/iterators.h') diff --git a/src/iterators.h b/src/iterators.h index ae2ddaf9..a1563539 100644 --- a/src/iterators.h +++ b/src/iterators.h @@ -255,12 +255,8 @@ class sorted_accounts_iterator : public accounts_iterator std::list sorted_accounts_end; public: - sorted_accounts_iterator(const expr_t& _sort_cmp, bool _flatten_all) - : sort_cmp(_sort_cmp), flatten_all(_flatten_all) { - TRACE_CTOR(sorted_accounts_iterator, "const expr_t&, bool"); - } - sorted_accounts_iterator(const expr_t& _sort_cmp, bool _flatten_all, - account_t& account) + sorted_accounts_iterator(account_t& account, + const expr_t& _sort_cmp, bool _flatten_all) : sort_cmp(_sort_cmp), flatten_all(_flatten_all) { TRACE_CTOR(sorted_accounts_iterator, "const expr_t&, bool, account_t&"); push_back(account); @@ -269,9 +265,9 @@ public: TRACE_DTOR(sorted_accounts_iterator); } - void sort_accounts(account_t& account, accounts_deque_t& deque); - void push_all(account_t& account); void push_back(account_t& account); + void push_all(account_t& account, accounts_deque_t& deque); + void sort_accounts(account_t& account, accounts_deque_t& deque); virtual account_t * operator()(); }; -- cgit v1.2.3