diff options
Diffstat (limited to 'qif.cc')
-rw-r--r-- | qif.cc | 18 |
1 files changed, 5 insertions, 13 deletions
@@ -63,7 +63,6 @@ unsigned int qif_parser_t::parse(std::istream& in, src_idx = journal->sources.size() - 1; linenum = 1; -#ifdef USE_EDITOR istream_pos_type beg_pos = 0; unsigned long beg_line = 0; @@ -72,9 +71,6 @@ unsigned int qif_parser_t::parse(std::istream& in, beg_pos = in.tellg(); \ beg_line = linenum; \ } -#else -#define SET_BEG_POS_AND_LINE() -#endif while (in.good() && ! in.eof()) { char c; @@ -119,16 +115,16 @@ unsigned int qif_parser_t::parse(std::istream& in, get_line(in); xact->amount.parse(line); - unsigned long flags = xact->amount.commodity().flags; - unsigned short prec = xact->amount.commodity().precision; + 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; + def_commodity->flags() |= flags; + if (prec > def_commodity->precision()) + def_commodity->precision() = prec; if (c == '$') { saw_splits = true; @@ -221,13 +217,11 @@ unsigned int qif_parser_t::parse(std::istream& in, } if (journal->add_entry(entry.get())) { -#ifdef USE_EDITOR entry->src_idx = src_idx; entry->beg_pos = beg_pos; entry->beg_line = beg_line; entry->end_pos = in.tellg(); entry->end_line = linenum; -#endif entry.release(); count++; } @@ -240,9 +234,7 @@ unsigned int qif_parser_t::parse(std::istream& in, saw_splits = false; saw_category = false; total = NULL; -#ifdef USE_EDITOR beg_line = 0; -#endif break; } |