From 2d941730b1c60342be5b108d2d654723b3b7c2cb Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Wed, 4 Feb 2009 19:55:27 -0400 Subject: Largely removed all of Ledger's use of global variables, for the REPL's sake. --- src/balance.cc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/balance.cc') diff --git a/src/balance.cc b/src/balance.cc index 7b1ed4dd..c9ca148d 100644 --- a/src/balance.cc +++ b/src/balance.cc @@ -181,6 +181,7 @@ balance_t::commodity_amount(const optional& commodity) const if (amounts.size() == 1) { return amounts.begin()->second; } +#if 0 else if (amounts.size() > 1) { // Try stripping annotations before giving an error. balance_t temp(strip_annotations()); @@ -190,6 +191,7 @@ balance_t::commodity_amount(const optional& commodity) const throw_(amount_error, "Requested amount of a balance with multiple commodities: " << temp); } +#endif } else if (amounts.size() > 0) { amounts_map::const_iterator i = amounts.find(&*commodity); @@ -199,14 +201,13 @@ balance_t::commodity_amount(const optional& commodity) const return none; } -balance_t balance_t::strip_annotations(const bool keep_price, - const bool keep_date, - const bool keep_tag) const +balance_t +balance_t::strip_annotations(const keep_details_t& what_to_keep) const { balance_t temp; foreach (const amounts_map::value_type& pair, amounts) - temp += pair.second.strip_annotations(keep_price, keep_date, keep_tag); + temp += pair.second.strip_annotations(what_to_keep); return temp; } -- cgit v1.2.3