summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/annotate.cc8
-rw-r--r--src/post.cc1
2 files changed, 3 insertions, 6 deletions
diff --git a/src/annotate.cc b/src/annotate.cc
index 98635ad7..c9fd6d3f 100644
--- a/src/annotate.cc
+++ b/src/annotate.cc
@@ -212,8 +212,7 @@ void annotation_t::print(std::ostream& out, bool keep_base,
(! no_computed_annotations || ! has_flags(ANNOTATION_TAG_CALCULATED)))
out << " (" << *tag << ')';
- if (value_expr && (! no_computed_annotations ||
- ! has_flags(ANNOTATION_VALUE_EXPR_CALCULATED)))
+ if (value_expr && ! has_flags(ANNOTATION_VALUE_EXPR_CALCULATED))
out << " ((" << *value_expr << "))";
}
@@ -327,10 +326,7 @@ annotated_commodity_t::strip_annotations(const keep_details_t& what_to_keep)
if ((keep_price && details.price) ||
(keep_date && details.date) ||
- (keep_tag && details.tag) ||
- (details.value_expr &&
- ! details.has_flags(ANNOTATION_VALUE_EXPR_CALCULATED)))
- {
+ (keep_tag && details.tag)) {
new_comm = pool().find_or_create
(referent(), annotation_t(keep_price ? details.price : none,
keep_date ? details.date : none,
diff --git a/src/post.cc b/src/post.cc
index d5e0d9bc..2b84fc06 100644
--- a/src/post.cc
+++ b/src/post.cc
@@ -688,6 +688,7 @@ void extend_post(post_t& post, journal_t& journal)
if (! details) {
annotation_t new_details;
new_details.value_expr = value_expr;
+
commodity_t * new_comm =
commodity_pool_t::current_pool->find_or_create(comm, new_details);
post.amount.set_commodity(*new_comm);