diff options
author | John Wiegley <johnw@newartisans.com> | 2010-06-14 03:18:32 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2010-06-14 03:23:09 -0400 |
commit | dcffd218a1e90ee9a1cdd295c0a3015edc395448 (patch) | |
tree | 5957423c9ef3d629461f413e163917626c300c9d /src/item.cc | |
parent | e2fa8c6145679231cda5ad6b6e7440f6f16e654a (diff) | |
download | fork-ledger-dcffd218a1e90ee9a1cdd295c0a3015edc395448.tar.gz fork-ledger-dcffd218a1e90ee9a1cdd295c0a3015edc395448.tar.bz2 fork-ledger-dcffd218a1e90ee9a1cdd295c0a3015edc395448.zip |
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.
Diffstat (limited to 'src/item.cc')
-rw-r--r-- | src/item.cc | 20 |
1 files changed, 9 insertions, 11 deletions
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<date_t::year_type> 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<date_t::year_type> 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 { |