From fa46f3442d2fa9e462c14564aecbfe34c16d18b2 Mon Sep 17 00:00:00 2001 From: Craig Earls Date: Sun, 24 Aug 2014 18:40:00 -0700 Subject: fix rare bug in balance report output if the budgeted amount happens to be zero. See emails in group from John Rakestraw circa November 2011 --- src/report.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/report.h b/src/report.h index c500fb9b..acfd40db 100644 --- a/src/report.h +++ b/src/report.h @@ -465,8 +465,8 @@ public: " 12 + 1 + 12 + 1 + 12, true, color))" " %(ansify_if(" " justify((get_at(display_total, 1) ? " - " (100% * scrub(get_at(display_total, 0))) / " - " -scrub(get_at(display_total, 1)) : 0), " + " (100% * quantity(scrub(get_at(display_total, 0)))) / " + " -quantity(scrub(get_at(display_total, 1))) : 0), " " 5, -1, true, false)," " magenta if (color and get_at(display_total, 1) and " " (abs(quantity(scrub(get_at(display_total, 0))) / " -- cgit v1.2.3 From df9ae3ab9b37fde803f26c6bc4eaadfd67fc1d07 Mon Sep 17 00:00:00 2001 From: Joe Gallo Date: Tue, 26 Aug 2014 09:07:57 -0400 Subject: fix "no viable conversion from ... to 'bool'" --- src/account.h | 2 +- src/item.h | 2 +- src/post.h | 2 +- src/times.h | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/account.h b/src/account.h index d1377c39..4a4041b7 100644 --- a/src/account.h +++ b/src/account.h @@ -261,7 +261,7 @@ public: mutable optional xdata_; bool has_xdata() const { - return xdata_; + return xdata_ != NULL; } void clear_xdata(); xdata_t& xdata() { diff --git a/src/item.h b/src/item.h index beb32a04..d194ac07 100644 --- a/src/item.h +++ b/src/item.h @@ -191,7 +191,7 @@ public: static bool use_aux_date; virtual bool has_date() const { - return _date; + return _date != NULL; } virtual date_t date() const { diff --git a/src/post.h b/src/post.h index c2f77b32..c4fc3827 100644 --- a/src/post.h +++ b/src/post.h @@ -205,7 +205,7 @@ public: mutable optional xdata_; bool has_xdata() const { - return xdata_; + return xdata_ != NULL; } void clear_xdata() { xdata_ = none; diff --git a/src/times.h b/src/times.h index 2a5b9277..d2f7bb19 100644 --- a/src/times.h +++ b/src/times.h @@ -568,7 +568,7 @@ public: void stabilize(const optional& date = none); bool is_valid() const { - return start; + return start != NULL; } /** Find the current or next period containing date. Returns false if -- cgit v1.2.3 From 38557ee63273dcdef22b136c5f424802c7ff6e03 Mon Sep 17 00:00:00 2001 From: Joe Gallo Date: Tue, 26 Aug 2014 09:09:06 -0400 Subject: fix "type 'char' cannot be used prior to '::'" --- src/ptree.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ptree.cc b/src/ptree.cc index 6609aed9..fa6a1db9 100644 --- a/src/ptree.cc +++ b/src/ptree.cc @@ -80,7 +80,7 @@ void format_ptree::flush() switch (format) { case FORMAT_XML: - property_tree::xml_writer_settings indented(' ', 2); + auto indented = property_tree::xml_writer_make_settings (' ', 2); property_tree::write_xml(out, pt, indented); out << std::endl; break; -- cgit v1.2.3