summaryrefslogtreecommitdiff
path: root/src/iterators.h
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-10-26 18:52:26 -0400
committerJohn Wiegley <johnw@newartisans.com>2009-10-26 18:52:26 -0400
commit151a8d87ee299b54da262346471aa71a729a6eb2 (patch)
treee2151c34eb1a2756e5e4324465ebf629ef4859e6 /src/iterators.h
parentd85a415bc5119d4271ca7355fe3e0ce3951c0d23 (diff)
downloadfork-ledger-151a8d87ee299b54da262346471aa71a729a6eb2.tar.gz
fork-ledger-151a8d87ee299b54da262346471aa71a729a6eb2.tar.bz2
fork-ledger-151a8d87ee299b54da262346471aa71a729a6eb2.zip
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.
Diffstat (limited to 'src/iterators.h')
-rw-r--r--src/iterators.h12
1 files changed, 4 insertions, 8 deletions
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<accounts_deque_t::const_iterator> 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()();
};