From dcffd218a1e90ee9a1cdd295c0a3015edc395448 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Mon, 14 Jun 2010 03:18:32 -0400 Subject: Revised how Ledger handles the "current year" Now when the Y directive sets the current year for a region, it affects everything, as if the clock really were set back to that year. --- src/item.cc | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) (limited to 'src/item.cc') diff --git a/src/item.cc b/src/item.cc index f0273e59..63f0f3a9 100644 --- a/src/item.cc +++ b/src/item.cc @@ -134,10 +134,9 @@ item_t::set_tag(const string& tag, } } -void item_t::parse_tags(const char * p, - scope_t& scope, - bool overwrite_existing, - optional current_year) +void item_t::parse_tags(const char * p, + scope_t& scope, + bool overwrite_existing) { if (const char * b = std::strchr(p, '[')) { if (*(b + 1) != '\0' && @@ -149,10 +148,10 @@ void item_t::parse_tags(const char * p, if (char * p = std::strchr(buf, '=')) { *p++ = '\0'; - _date_eff = parse_date(p, current_year); + _date_eff = parse_date(p); } if (buf[0]) - _date = parse_date(buf, current_year); + _date = parse_date(buf); } } } @@ -202,10 +201,9 @@ void item_t::parse_tags(const char * p, } } -void item_t::append_note(const char * p, - scope_t& scope, - bool overwrite_existing, - optional current_year) +void item_t::append_note(const char * p, + scope_t& scope, + bool overwrite_existing) { if (note) { *note += '\n'; @@ -214,7 +212,7 @@ void item_t::append_note(const char * p, note = p; } - parse_tags(p, scope, overwrite_existing, current_year); + parse_tags(p, scope, overwrite_existing); } namespace { -- cgit v1.2.3