From 05b2cc46fdf6accd2ecbdc3c1ce86829bc7bfa68 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Mon, 9 Aug 2004 17:32:20 -0400 Subject: fixed account display bug --- walk.h | 36 ++++++++++++++++-------------------- 1 file changed, 16 insertions(+), 20 deletions(-) (limited to 'walk.h') diff --git a/walk.h b/walk.h index d8224c3d..e01b5d97 100644 --- a/walk.h +++ b/walk.h @@ -154,25 +154,22 @@ inline void sort_accounts(account_t * account, } template -void walk__accounts(account_t * account, - const Function& functor, - const unsigned int max_depth) +void walk__accounts(account_t * account, const Function& functor) { - functor(account, max_depth); + functor(account); for (accounts_map::const_iterator i = account->accounts.begin(); i != account->accounts.end(); i++) - walk__accounts((*i).second, functor, max_depth); + walk__accounts((*i).second, functor); } template -void walk__accounts_sorted(account_t * account, - const Function& functor, - const unsigned int max_depth, - const node_t * sort_order) +void walk__accounts_sorted(account_t * account, + const Function& functor, + const node_t * sort_order) { - functor(account, max_depth); + functor(account); accounts_deque accounts; @@ -187,7 +184,7 @@ void walk__accounts_sorted(account_t * account, for (accounts_deque::const_iterator i = accounts.begin(); i != accounts.end(); i++) - walk__accounts_sorted(*i, functor, max_depth, sort_order); + walk__accounts_sorted(*i, functor, sort_order); } template @@ -217,13 +214,12 @@ inline void sum__accounts(account_t * account) } template -void walk_accounts(account_t * account, - const Function& functor, - const node_t * predicate, - unsigned int flags, - const bool calc_subtotals, - const unsigned int max_depth, - const node_t * sort_order = NULL) +void walk_accounts(account_t * account, + const Function& functor, + const node_t * predicate, + unsigned int flags, + const bool calc_subtotals, + const node_t * sort_order = NULL) { item_predicate pred_functor(predicate); @@ -232,9 +228,9 @@ void walk_accounts(account_t * account, sum__accounts(account); if (sort_order) - walk__accounts_sorted(account, functor, max_depth, sort_order); + walk__accounts_sorted(account, functor, sort_order); else - walk__accounts(account, functor, max_depth); + walk__accounts(account, functor); } } // namespace ledger -- cgit v1.2.3