diff options
author | John Wiegley <johnw@newartisans.com> | 2009-03-05 22:39:32 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2009-03-05 22:39:32 -0400 |
commit | a2c73120809ba78dfdeb75f5ff0956e5f41e5975 (patch) | |
tree | 51a40c60160181008f2a0bf2f9da70e337464df8 /src/post.cc | |
parent | 324f46460683255d0fa6a7b08210ca8fe7f2c398 (diff) | |
download | fork-ledger-a2c73120809ba78dfdeb75f5ff0956e5f41e5975.tar.gz fork-ledger-a2c73120809ba78dfdeb75f5ff0956e5f41e5975.tar.bz2 fork-ledger-a2c73120809ba78dfdeb75f5ff0956e5f41e5975.zip |
Renamed some flags and members in post_t
Diffstat (limited to 'src/post.cc')
-rw-r--r-- | src/post.cc | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/src/post.cc b/src/post.cc index 4289433e..98899946 100644 --- a/src/post.cc +++ b/src/post.cc @@ -140,12 +140,10 @@ namespace { } value_t get_amount(post_t& post) { - if (post.has_xdata() && - post.xdata().has_flags(POST_EXT_COMPOUND)) { - return post.xdata().value; - } else { + if (post.has_xdata() && post.xdata().has_flags(POST_EXT_COMPOUND)) + return post.xdata().compound_value; + else return post.amount; - } } value_t get_use_direct_amount(post_t& post) { @@ -169,7 +167,7 @@ namespace { return *post.cost; else if (post.has_xdata() && post.xdata().has_flags(POST_EXT_COMPOUND)) - return post.xdata().value; + return post.xdata().compound_value; else return post.amount; } @@ -365,13 +363,13 @@ bool post_t::valid() const return true; } -void post_t::add_to_value(value_t& value, expr_t& expr) +void post_t::add_to_value(value_t& value, const optional<expr_t&>& expr) const { if (xdata_ && xdata_->has_flags(POST_EXT_COMPOUND)) { - add_or_set_value(value, xdata_->value); + add_or_set_value(value, xdata_->compound_value); } else { - bind_scope_t bound_scope(*expr.get_context(), *this); - add_or_set_value(value, expr.calc(bound_scope)); + bind_scope_t bound_scope(*expr->get_context(), const_cast<post_t&>(*this)); + add_or_set_value(value, expr->calc(bound_scope)); } } |