From 65bfc5756cbc18b411f5999e373d500cef976cdd Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Fri, 27 May 2005 03:47:53 +0000 Subject: (qif_parser_t::parse): Propogate commodity flags when parsing amounts from a QIF file. --- qif.cc | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/qif.cc b/qif.cc index 70b61a0b..7d4266d7 100644 --- a/qif.cc +++ b/qif.cc @@ -92,15 +92,25 @@ unsigned int qif_parser_t::parse(std::istream& in, break; case 'T': - case '$': + case '$': { in >> line; xact->amount.parse(line); + + unsigned long flags = xact->amount.commodity().flags; + unsigned short prec = xact->amount.commodity().precision; + if (! def_commodity) def_commodity = commodity_t::find_commodity("$", true); xact->amount.set_commodity(*def_commodity); + + def_commodity->flags |= flags; + if (prec > def_commodity->precision) + def_commodity->precision = prec; + if (c == '$') xact->amount.negate(); break; + } case 'C': if (in.peek() == '*') { -- cgit v1.2.3