summaryrefslogtreecommitdiff
path: root/src/textual.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-02-26 05:30:48 -0400
committerJohn Wiegley <johnw@newartisans.com>2009-02-26 05:30:48 -0400
commitbadea0058402837961125bd000ced2a132591cbf (patch)
tree4873746732a154c152a99bdda968c626526ff5e0 /src/textual.cc
parent87ec7bc34a78ae67101514d6507b90fe691e0010 (diff)
downloadledger-badea0058402837961125bd000ced2a132591cbf.tar.gz
ledger-badea0058402837961125bd000ced2a132591cbf.tar.bz2
ledger-badea0058402837961125bd000ced2a132591cbf.zip
Added a warning_() macro
Diffstat (limited to 'src/textual.cc')
-rw-r--r--src/textual.cc20
1 files changed, 6 insertions, 14 deletions
diff --git a/src/textual.cc b/src/textual.cc
index da686ec9..fb03f04d 100644
--- a/src/textual.cc
+++ b/src/textual.cc
@@ -810,13 +810,9 @@ post_t * instance_t::parse_post(char * line,
post->account = account->find_account(name);
if (honor_strict && strict && ! post->account->known) {
- if (post->_state == item_t::UNCLEARED) {
- straccstream accum;
- std::cerr
- << ACCUM(accum << _("Warning: \"%1\", line %2: Unknown account '%3'")
- << pathname << linenum << post->account->fullname())
- << std::endl;
- }
+ if (post->_state == item_t::UNCLEARED)
+ warning_(_("\"%1\", line %2: Unknown account '%3'")
+ << pathname << linenum << post->account->fullname());
post->account->known = true;
}
@@ -840,13 +836,9 @@ post_t * instance_t::parse_post(char * line,
if (! post->amount.is_null() && honor_strict && strict &&
post->amount.has_commodity() &&
! post->amount.commodity().has_flags(COMMODITY_KNOWN)) {
- if (post->_state == item_t::UNCLEARED) {
- straccstream accum;
- std::cerr
- << ACCUM(accum << _("Warning: \"%1\", line %2: Unknown commodity '%3'")
- << pathname << linenum << post->amount.commodity())
- << std::endl;
- }
+ if (post->_state == item_t::UNCLEARED)
+ warning_(_("\"%1\", line %2: Unknown commodity '%3'")
+ << pathname << linenum << post->amount.commodity());
post->amount.commodity().add_flags(COMMODITY_KNOWN);
}