diff options
author | John Wiegley <johnw@newartisans.com> | 2009-02-04 19:55:27 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2009-02-04 19:55:27 -0400 |
commit | 2d941730b1c60342be5b108d2d654723b3b7c2cb (patch) | |
tree | 6a3f4b7305857e85d2684670492007bafc3668d0 /src/balance.cc | |
parent | 73cf3b01fbd50c3a8a4fd96ff69643c28394d8fe (diff) | |
download | fork-ledger-2d941730b1c60342be5b108d2d654723b3b7c2cb.tar.gz fork-ledger-2d941730b1c60342be5b108d2d654723b3b7c2cb.tar.bz2 fork-ledger-2d941730b1c60342be5b108d2d654723b3b7c2cb.zip |
Largely removed all of Ledger's use of global variables, for the REPL's sake.
Diffstat (limited to 'src/balance.cc')
-rw-r--r-- | src/balance.cc | 9 |
1 files changed, 5 insertions, 4 deletions
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<const commodity_t&>& 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<const commodity_t&>& 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<const commodity_t&>& 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; } |