summaryrefslogtreecommitdiff
path: root/src/post.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2010-05-30 02:55:02 -0600
committerJohn Wiegley <johnw@newartisans.com>2010-05-30 03:01:11 -0600
commit4f3b39e22c7a7743132ead79b1e092929679de44 (patch)
treeb49eeb433c03f71318b64a0dc4d0d0d5ebea2d4f /src/post.cc
parent647d4aac2fa474085d01f7ea1cebdc34fafd64a6 (diff)
downloadfork-ledger-4f3b39e22c7a7743132ead79b1e092929679de44.tar.gz
fork-ledger-4f3b39e22c7a7743132ead79b1e092929679de44.tar.bz2
fork-ledger-4f3b39e22c7a7743132ead79b1e092929679de44.zip
Empty notes and tags now return null values
Diffstat (limited to 'src/post.cc')
-rw-r--r--src/post.cc12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/post.cc b/src/post.cc
index f1f3e96a..7dc15830 100644
--- a/src/post.cc
+++ b/src/post.cc
@@ -150,7 +150,7 @@ namespace {
if (post.xact->code)
return string_value(*post.xact->code);
else
- return string_value(empty_string);
+ return NULL_VALUE;
}
value_t get_payee(post_t& post) {
@@ -158,9 +158,13 @@ namespace {
}
value_t get_note(post_t& post) {
- string note = post.note ? *post.note : empty_string;
- note += post.xact->note ? *post.xact->note : empty_string;
- return string_value(note);
+ if (post.note || post.xact->note) {
+ string note = post.note ? *post.note : empty_string;
+ note += post.xact->note ? *post.xact->note : empty_string;
+ return string_value(note);
+ } else {
+ return NULL_VALUE;
+ }
}
value_t get_magnitude(post_t& post) {