diff options
author | John Wiegley <johnw@newartisans.com> | 2009-02-04 19:55:27 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2009-02-04 19:55:27 -0400 |
commit | 2d941730b1c60342be5b108d2d654723b3b7c2cb (patch) | |
tree | 6a3f4b7305857e85d2684670492007bafc3668d0 /src/xact.cc | |
parent | 73cf3b01fbd50c3a8a4fd96ff69643c28394d8fe (diff) | |
download | ledger-2d941730b1c60342be5b108d2d654723b3b7c2cb.tar.gz ledger-2d941730b1c60342be5b108d2d654723b3b7c2cb.tar.bz2 ledger-2d941730b1c60342be5b108d2d654723b3b7c2cb.zip |
Largely removed all of Ledger's use of global variables, for the REPL's sake.
Diffstat (limited to 'src/xact.cc')
-rw-r--r-- | src/xact.cc | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/xact.cc b/src/xact.cc index fbd3e8bb..c154d31c 100644 --- a/src/xact.cc +++ b/src/xact.cc @@ -36,12 +36,13 @@ namespace ledger { -optional<date_t> xact_t::actual_date() const +date_t xact_t::date() const { - optional<date_t> date = item_t::actual_date(); - if (! date && entry) - return entry->actual_date(); - return date; + if (! _date) { + assert(entry); + return entry->date(); + } + return item_t::date(); } optional<date_t> xact_t::effective_date() const @@ -129,7 +130,7 @@ namespace { value_t get_account(call_scope_t& scope) { - xact_t& xact(downcast<xact_t>(*scope.parent)); + xact_t& xact(find_scope<xact_t>(scope)); var_t<long> max_width(scope, 0); |