summaryrefslogtreecommitdiff
path: root/walk.h
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2004-08-09 17:32:20 -0400
committerJohn Wiegley <johnw@newartisans.com>2004-08-09 17:32:20 -0400
commit05b2cc46fdf6accd2ecbdc3c1ce86829bc7bfa68 (patch)
treeab61a5efdcdfe7bb73f346da5e45ac228d6458c0 /walk.h
parent2dc822291f3ecef34eb0ef2920c395b0e056fbda (diff)
downloadfork-ledger-05b2cc46fdf6accd2ecbdc3c1ce86829bc7bfa68.tar.gz
fork-ledger-05b2cc46fdf6accd2ecbdc3c1ce86829bc7bfa68.tar.bz2
fork-ledger-05b2cc46fdf6accd2ecbdc3c1ce86829bc7bfa68.zip
fixed account display bug
Diffstat (limited to 'walk.h')
-rw-r--r--walk.h36
1 files changed, 16 insertions, 20 deletions
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 <typename Function>
-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 <typename Function>
-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 <typename Function>
@@ -217,13 +214,12 @@ inline void sum__accounts(account_t * account)
}
template <typename Function>
-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<transaction_t> pred_functor(predicate);
@@ -232,9 +228,9 @@ void walk_accounts(account_t * account,
sum__accounts(account);
if (sort_order)
- walk__accounts_sorted<Function>(account, functor, max_depth, sort_order);
+ walk__accounts_sorted<Function>(account, functor, sort_order);
else
- walk__accounts<Function>(account, functor, max_depth);
+ walk__accounts<Function>(account, functor);
}
} // namespace ledger