From 9c9a34388a0697c4c4c4bd126ec8dd7e1244cd48 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Mon, 4 Aug 2008 16:24:41 -0400 Subject: First round of work to get the balance report working again. --- xml.cc | 88 ++++++++++++++++++++++++++++++++++-------------------------------- 1 file changed, 45 insertions(+), 43 deletions(-) (limited to 'xml.cc') diff --git a/xml.cc b/xml.cc index d019d6d9..715965cb 100644 --- a/xml.cc +++ b/xml.cc @@ -387,28 +387,30 @@ void output_xml_string(std::ostream& out, const string& str) void format_xml_entries::format_last_entry() { + std::ostream& out(*report.output_stream); + #if 0 // jww (2008-05-08): Need to format these dates - output_stream << " \n" - << " " << last_entry->_date.to_string("%Y/%m/%d") - << "\n"; + out << " \n" + << " " << last_entry->_date.to_string("%Y/%m/%d") + << "\n"; if (is_valid(last_entry->_date_eff)) - output_stream << " " - << last_entry->_date_eff.to_string("%Y/%m/%d") - << "\n"; + out << " " + << last_entry->_date_eff.to_string("%Y/%m/%d") + << "\n"; #endif if (last_entry->code) { - output_stream << " "; - output_xml_string(output_stream, *last_entry->code); - output_stream << "\n"; + out << " "; + output_xml_string(out, *last_entry->code); + out << "\n"; } if (! last_entry->payee.empty()) { - output_stream << " "; - output_xml_string(output_stream, last_entry->payee); - output_stream << "\n"; + out << " "; + output_xml_string(out, last_entry->payee); + out << "\n"; } bool first = true; @@ -416,34 +418,34 @@ void format_xml_entries::format_last_entry() if (xact->has_xdata() && xact->xdata().has_flags(XACT_EXT_TO_DISPLAY)) { if (first) { - output_stream << " \n"; + out << " \n"; first = false; } - output_stream << " \n"; + out << " \n"; #if 0 // jww (2008-05-08): Need to format these if (xact->_date) - output_stream << " " - << xact->_date.to_string("%Y/%m/%d") - << "\n"; + out << " " + << xact->_date.to_string("%Y/%m/%d") + << "\n"; if (is_valid(xact->_date_eff)) - output_stream << " " - << xact->_date_eff.to_string("%Y/%m/%d") - << "\n"; + out << " " + << xact->_date_eff.to_string("%Y/%m/%d") + << "\n"; #endif if (xact->state == xact_t::CLEARED) - output_stream << " \n"; + out << " \n"; else if (xact->state == xact_t::PENDING) - output_stream << " \n"; + out << " \n"; if (xact->has_flags(XACT_VIRTUAL)) - output_stream << " \n"; + out << " \n"; if (xact->has_flags(XACT_AUTO)) - output_stream << " \n"; + out << " \n"; if (xact->account) { string name = xact->account->fullname(); @@ -452,46 +454,46 @@ void format_xml_entries::format_last_entry() else if (name == "") name = "[UNKNOWN]"; - output_stream << " "; - output_xml_string(output_stream, name); - output_stream << "\n"; + out << " "; + output_xml_string(out, name); + out << "\n"; } - output_stream << " \n"; + out << " \n"; if (xact->xdata().has_flags(XACT_EXT_COMPOUND)) - xml_write_value(output_stream, xact->xdata().value, 10); + xml_write_value(out, xact->xdata().value, 10); else - xml_write_value(output_stream, value_t(xact->amount), 10); - output_stream << " \n"; + xml_write_value(out, value_t(xact->amount), 10); + out << " \n"; if (xact->cost) { - output_stream << " \n"; - xml_write_value(output_stream, value_t(*xact->cost), 10); - output_stream << " \n"; + out << " \n"; + xml_write_value(out, value_t(*xact->cost), 10); + out << " \n"; } if (xact->note) { - output_stream << " "; - output_xml_string(output_stream, *xact->note); - output_stream << "\n"; + out << " "; + output_xml_string(out, *xact->note); + out << "\n"; } if (show_totals) { - output_stream << " \n"; - xml_write_value(output_stream, xact->xdata().total, 10); - output_stream << " \n"; + out << " \n"; + xml_write_value(out, xact->xdata().total, 10); + out << " \n"; } - output_stream << " \n"; + out << " \n"; xact->xdata().add_flags(XACT_EXT_DISPLAYED); } } if (! first) - output_stream << " \n"; + out << " \n"; - output_stream << " \n"; + out << " \n"; } } // namespace ledger -- cgit v1.2.3