summaryrefslogtreecommitdiff
path: root/src/annotate.h
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2012-03-29 16:28:53 -0500
committerJohn Wiegley <johnw@newartisans.com>2012-03-29 16:28:53 -0500
commitb5e76f005690e1c94245af430bdfae8dd4a8915f (patch)
treed125a668ecd9058952c321295da9dc9018072525 /src/annotate.h
parent0f180b917ae00b7b247db367020fd29823000877 (diff)
downloadfork-ledger-b5e76f005690e1c94245af430bdfae8dd4a8915f.tar.gz
fork-ledger-b5e76f005690e1c94245af430bdfae8dd4a8915f.tar.bz2
fork-ledger-b5e76f005690e1c94245af430bdfae8dd4a8915f.zip
Fix to commodity printing
Diffstat (limited to 'src/annotate.h')
-rw-r--r--src/annotate.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/annotate.h b/src/annotate.h
index 878d6148..37ee0685 100644
--- a/src/annotate.h
+++ b/src/annotate.h
@@ -265,9 +265,14 @@ public:
virtual void print(std::ostream& out, bool elide_quotes = false,
bool print_annotations = false) const {
- commodity_t::print(out, elide_quotes);
- if (print_annotations)
- write_annotations(out);
+ if (print_annotations) {
+ std::ostringstream buf;
+ commodity_t::print(buf, elide_quotes);
+ write_annotations(buf);
+ out << buf.str();
+ } else {
+ commodity_t::print(out, elide_quotes);
+ }
}
virtual void write_annotations(std::ostream& out,