From e92bcf411d2e9a55969303ba3893a017152d7c18 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Tue, 1 May 2007 04:36:49 +0000 Subject: Started using boost::optional. --- src/gnucash.cc | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/gnucash.cc') diff --git a/src/gnucash.cc b/src/gnucash.cc index 3859ebb4..0fb62bf0 100644 --- a/src/gnucash.cc +++ b/src/gnucash.cc @@ -77,7 +77,7 @@ void endElement(void *userData, const char *name) if (! parser->curr_journal->add_entry(parser->curr_entry)) { print_entry(std::cerr, *parser->curr_entry); parser->have_error = "The above entry does not balance"; - delete parser->curr_entry; + checked_delete(parser->curr_entry); } else { parser->curr_entry->src_idx = parser->src_idx; parser->curr_entry->beg_pos = parser->beg_pos; @@ -122,7 +122,7 @@ void endElement(void *userData, const char *name) xact->state = parser->curr_state; xact->amount = value; if (value != parser->curr_value) - xact->cost = new amount_t(parser->curr_value); + xact->cost = amount_t(parser->curr_value); xact->beg_pos = parser->beg_pos; xact->beg_line = parser->beg_line; @@ -291,10 +291,10 @@ bool gnucash_parser_t::test(std::istream& in) const return std::strncmp(buf, "& original_file) { char buf[BUFSIZ]; @@ -315,7 +315,7 @@ unsigned int gnucash_parser_t::parse(std::istream& in, curr_state = transaction_t::UNCLEARED; instreamp = ∈ - path = original_file ? *original_file : ""; + pathname = original_file ? *original_file : ""; src_idx = journal->sources.size() - 1; // GnuCash uses the USD commodity without defining it, which really -- cgit v1.2.3