summaryrefslogtreecommitdiff
path: root/src/annotate.cc
diff options
context:
space:
mode:
authorCraig Earls <enderw88@gmail.com>2013-03-09 12:27:08 -0500
committerCraig Earls <enderw88@gmail.com>2013-03-09 12:27:08 -0500
commitca99c0de03432393aa6576244005c9ad8806fa29 (patch)
treebf0dd4586adb4b7df1adad8a5eff5d2bca36f4e3 /src/annotate.cc
parent4c608cccd0c6f06f403882dcca36cb62a40178a2 (diff)
parentbfe360d4c992caf2e7da09ab058599c0404f1348 (diff)
downloadledger-ca99c0de03432393aa6576244005c9ad8806fa29.tar.gz
ledger-ca99c0de03432393aa6576244005c9ad8806fa29.tar.bz2
ledger-ca99c0de03432393aa6576244005c9ad8806fa29.zip
Merge branch 'next' into ledger-mode-automatic-transactions
Diffstat (limited to 'src/annotate.cc')
-rw-r--r--src/annotate.cc16
1 files changed, 5 insertions, 11 deletions
diff --git a/src/annotate.cc b/src/annotate.cc
index 12016868..8816a89c 100644
--- a/src/annotate.cc
+++ b/src/annotate.cc
@@ -216,19 +216,13 @@ void annotation_t::print(std::ostream& out, bool keep_base,
out << " ((" << *value_expr << "))";
}
-void put_annotation(property_tree::ptree& pt, const annotation_t& details)
+void put_annotation(property_tree::ptree& st, const annotation_t& details)
{
- property_tree::ptree& st(pt.put("annotation", ""));
+ if (details.price)
+ put_amount(st.put("price", ""), *details.price);
- if (details.price) {
- property_tree::ptree& t(st.put("price", ""));
- put_amount(t, *details.price, false);
- }
-
- if (details.date) {
- property_tree::ptree& t(st.put("date", ""));
- put_date(t, *details.date, false);
- }
+ if (details.date)
+ put_date(st.put("date", ""), *details.date);
if (details.tag)
st.put("tag", *details.tag);