From 2d62f7b633bdaa39c650bb67425514cf1e66a4dd Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Sun, 29 Aug 2004 04:31:59 -0400 Subject: redid the way amount_t::commodity is handled; no more direct access --- textual.cc | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'textual.cc') diff --git a/textual.cc b/textual.cc index 0e8bdee1..1c50d725 100644 --- a/textual.cc +++ b/textual.cc @@ -100,11 +100,6 @@ transaction_t * parse_transaction_text(char * line, account_t * account, xact->account = account->find_account(p); - if (! xact->amount.commodity) - xact->amount.commodity = commodity_t::null_commodity; - if (xact->cost && ! xact->cost->commodity) - xact->cost->commodity = commodity_t::null_commodity; - return xact.release(); } @@ -180,7 +175,7 @@ bool finalize_entry(entry_t * entry) = ((balance_t *) balance.data)->amounts.begin(); i != ((balance_t *) balance.data)->amounts.end(); i++) - if ((*i).second.commodity != (*x)->amount.commodity) { + if ((*i).second.commodity() != (*x)->amount.commodity()) { assert((*x)->amount); balance -= (*x)->amount; assert(! (*x)->cost); @@ -401,7 +396,7 @@ unsigned int textual_parser_t::parse(std::istream& in, std::sprintf(buf, "%fh", diff); amount_t amt; amt.parse(buf); - time_commodity = amt.commodity; + time_commodity = &amt.commodity(); transaction_t * xact = new transaction_t(last_account, amt, TRANSACTION_VIRTUAL); -- cgit v1.2.3