From 75b7294a6db10e7f7b18b6aeef1aa0f568124a1d Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Sun, 7 Mar 2010 22:47:07 -0500 Subject: Rewrite the "print" command as a custom function There ended up being too many corner cases for the generalized formatter to handle. --- src/output.cc | 24 +++--------------------- 1 file changed, 3 insertions(+), 21 deletions(-) (limited to 'src/output.cc') diff --git a/src/output.cc b/src/output.cc index c3afc9bc..30775310 100644 --- a/src/output.cc +++ b/src/output.cc @@ -42,10 +42,8 @@ namespace ledger { format_posts::format_posts(report_t& _report, const string& format, - bool _print_raw, const optional& _prepend_format) - : report(_report), last_xact(NULL), last_post(NULL), - print_raw(_print_raw) + : report(_report), last_xact(NULL), last_post(NULL) { TRACE_CTOR(format_posts, "report&, const string&, bool"); @@ -80,24 +78,8 @@ void format_posts::operator()(post_t& post) { std::ostream& out(report.output_stream); - if (print_raw) { - if (! post.has_xdata() || - ! post.xdata().has_flags(POST_EXT_DISPLAYED)) { - if (last_xact != post.xact) { - if (last_xact) { - bind_scope_t xact_scope(report, *last_xact); - out << between_format(xact_scope); - } - print_item(out, *post.xact); - out << '\n'; - last_xact = post.xact; - } - post.xdata().add_flags(POST_EXT_DISPLAYED); - last_post = &post; - } - } - else if (! post.has_xdata() || - ! post.xdata().has_flags(POST_EXT_DISPLAYED)) { + if (! post.has_xdata() || + ! post.xdata().has_flags(POST_EXT_DISPLAYED)) { bind_scope_t bound_scope(report, post); if (prepend_format) -- cgit v1.2.3