From ed8a236fe6f4e6eb0610da20146aad1ce8a62465 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Wed, 13 Jul 2005 08:53:47 +0000 Subject: (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. --- walk.h | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'walk.h') diff --git a/walk.h b/walk.h index f04eb41b..b59195b3 100644 --- a/walk.h +++ b/walk.h @@ -367,8 +367,18 @@ class changed_value_transactions : public item_handler class subtotal_transactions : public item_handler { - typedef std::map values_map; - typedef std::pair 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 values_map; + typedef std::pair values_pair; protected: values_map values; -- cgit v1.2.3