summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2012-04-04 01:36:31 -0500
committerJohn Wiegley <johnw@newartisans.com>2012-04-04 02:26:34 -0500
commitfcabd64a8981004179fa94c0f58ade7e993399b4 (patch)
treec50193a516fc79cded05cad82703ad3068386d18 /src
parent1809e63fb0e6f7e64d7c2af73e41a24225809ea2 (diff)
downloadfork-ledger-fcabd64a8981004179fa94c0f58ade7e993399b4.tar.gz
fork-ledger-fcabd64a8981004179fa94c0f58ade7e993399b4.tar.bz2
fork-ledger-fcabd64a8981004179fa94c0f58ade7e993399b4.zip
Whitespace fix
Diffstat (limited to 'src')
-rw-r--r--src/item.cc5
-rw-r--r--src/item.h3
-rw-r--r--src/post.cc29
-rw-r--r--src/post.h4
-rw-r--r--src/textual.cc9
5 files changed, 22 insertions, 28 deletions
diff --git a/src/item.cc b/src/item.cc
index 33c3110c..9e8ac472 100644
--- a/src/item.cc
+++ b/src/item.cc
@@ -117,9 +117,8 @@ item_t::set_tag(const string& tag,
<< (value ? *value : string_value("<none>")) << "'");
optional<value_t> data = value;
- if (data &&
- (data->is_null() ||
- (data->is_string() && data->as_string().empty())))
+ if (data && (data->is_null() ||
+ (data->is_string() && data->as_string().empty())))
data = none;
string_map::iterator i = metadata->find(tag);
diff --git a/src/item.h b/src/item.h
index a1160329..1e8db1e0 100644
--- a/src/item.h
+++ b/src/item.h
@@ -118,8 +118,7 @@ public:
optional<string_map> metadata;
item_t(flags_t _flags = ITEM_NORMAL, const optional<string>& _note = none)
- : supports_flags<uint_least16_t>(_flags), _state(UNCLEARED),
- note(_note)
+ : supports_flags<uint_least16_t>(_flags), _state(UNCLEARED), note(_note)
{
TRACE_CTOR(item_t, "flags_t, const string&");
}
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<mask_t>& value_mask,
- bool inherit) const
+ bool inherit) const
{
if (item_t::has_tag(tag_mask, value_mask))
return true;
@@ -69,9 +69,9 @@ optional<value_t> post_t::get_tag(const string& tag, bool inherit) const
return none;
}
-optional<value_t> post_t::get_tag(const mask_t& tag_mask,
+optional<value_t> post_t::get_tag(const mask_t& tag_mask,
const optional<mask_t>& value_mask,
- bool inherit) const
+ bool inherit) const
{
if (optional<value_t> 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<date_t> 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()
diff --git a/src/post.h b/src/post.h
index e2d9499f..78928f23 100644
--- a/src/post.h
+++ b/src/post.h
@@ -120,10 +120,10 @@ public:
bool inherit = true) const;
virtual optional<value_t> get_tag(const string& tag,
- bool inherit = true) const;
+ bool inherit = true) const;
virtual optional<value_t> get_tag(const mask_t& tag_mask,
const optional<mask_t>& value_mask = none,
- bool inherit = true) const;
+ bool inherit = true) const;
virtual date_t value_date() const;
virtual date_t date() const;
diff --git a/src/textual.cc b/src/textual.cc
index 0cb7fb81..d0e4dad2 100644
--- a/src/textual.cc
+++ b/src/textual.cc
@@ -1124,11 +1124,10 @@ void instance_t::tag_directive(char * line)
if (keyword == "assert" || keyword == "check") {
context.journal->tag_check_exprs.insert
(tag_check_exprs_map::value_type
- (string(p),
- expr_t::check_expr_pair(expr_t(b),
- keyword == "assert" ?
- expr_t::EXPR_ASSERTION :
- expr_t::EXPR_CHECK)));
+ (string(p), expr_t::check_expr_pair(expr_t(b),
+ keyword == "assert" ?
+ expr_t::EXPR_ASSERTION :
+ expr_t::EXPR_CHECK)));
}
}
}