From fcabd64a8981004179fa94c0f58ade7e993399b4 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Wed, 4 Apr 2012 01:36:31 -0500 Subject: Whitespace fix --- src/post.cc | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) (limited to 'src/post.cc') diff --git a/src/post.cc b/src/post.cc index 2b84fc06..0564eaca 100644 --- a/src/post.cc +++ b/src/post.cc @@ -49,9 +49,9 @@ bool post_t::has_tag(const string& tag, bool inherit) const return false; } -bool post_t::has_tag(const mask_t& tag_mask, +bool post_t::has_tag(const mask_t& tag_mask, const optional& value_mask, - bool inherit) const + bool inherit) const { if (item_t::has_tag(tag_mask, value_mask)) return true; @@ -69,9 +69,9 @@ optional post_t::get_tag(const string& tag, bool inherit) const return none; } -optional post_t::get_tag(const mask_t& tag_mask, +optional post_t::get_tag(const mask_t& tag_mask, const optional& value_mask, - bool inherit) const + bool inherit) const { if (optional value = item_t::get_tag(tag_mask, value_mask)) return value; @@ -93,17 +93,11 @@ date_t post_t::date() const return xdata_->date; if (item_t::use_aux_date) { - if (_date_aux) - return *_date_aux; - else if (xact && xact->_date_aux) - return *xact->_date_aux; + if (optional aux = aux_date()) + return *aux; } - if (! _date) { - assert(xact); - return xact->date(); - } - return *_date; + return primary_date(); } date_t post_t::primary_date() const @@ -174,7 +168,8 @@ namespace { return string_value(post.payee()); } - value_t get_note(post_t& post) { + value_t get_note(post_t& post) + { if (post.note || post.xact->note) { string note = post.note ? *post.note : empty_string; note += post.xact->note ? *post.xact->note : empty_string; @@ -188,7 +183,8 @@ namespace { return post.xact->magnitude(); } - value_t get_amount(post_t& post) { + value_t get_amount(post_t& post) + { if (post.has_xdata() && post.xdata().has_flags(POST_EXT_COMPOUND)) return post.xdata().compound_value; else if (post.amount.is_null()) @@ -215,7 +211,8 @@ namespace { } } - value_t get_commodity_is_primary(post_t& post) { + value_t get_commodity_is_primary(post_t& post) + { if (post.has_xdata() && post.xdata().has_flags(POST_EXT_COMPOUND)) return post.xdata().compound_value.to_amount() -- cgit v1.2.3