diff options
author | John Wiegley <johnw@newartisans.com> | 2005-07-13 08:53:47 +0000 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2008-04-13 02:41:15 -0400 |
commit | ed8a236fe6f4e6eb0610da20146aad1ce8a62465 (patch) | |
tree | d41be2d23cda93bf29ddc00aabe7d2e6661e2ef3 /walk.h | |
parent | d83aa2f732782356393b0e45a61ecfabd28d838d (diff) | |
download | fork-ledger-ed8a236fe6f4e6eb0610da20146aad1ce8a62465.tar.gz fork-ledger-ed8a236fe6f4e6eb0610da20146aad1ce8a62465.tar.bz2 fork-ledger-ed8a236fe6f4e6eb0610da20146aad1ce8a62465.zip |
(subtotal_transactions::operator()): Changed the usage of the
temporary `values' map so that account names are always properly
sorted in the subtotaled output view. As it was, they were being
reported in account creation order.
Diffstat (limited to 'walk.h')
-rw-r--r-- | walk.h | 14 |
1 files changed, 12 insertions, 2 deletions
@@ -367,8 +367,18 @@ class changed_value_transactions : public item_handler<transaction_t> class subtotal_transactions : public item_handler<transaction_t> { - typedef std::map<account_t *, value_t> values_map; - typedef std::pair<account_t *, value_t> values_pair; + struct acct_value_t { + account_t * account; + value_t value; + + acct_value_t(account_t * a) : account(a) {} + acct_value_t(account_t * a, value_t& v) : account(a), value(v) {} + acct_value_t(const acct_value_t& av) + : account(av.account), value(av.value) {} + }; + + typedef std::map<std::string, acct_value_t> values_map; + typedef std::pair<std::string, acct_value_t> values_pair; protected: values_map values; |