Got changed_value_xacts working again.

This commit is contained in:
John Wiegley 2009-01-19 22:30:11 -04:00
parent ce49245667
commit ad9a469a2a
2 changed files with 9 additions and 20 deletions

View file

@ -310,15 +310,7 @@ void changed_value_xacts::output_diff(const date_t& date)
value_t cur_bal;
last_xact->xdata().date = date;
#if 0
compute_total(cur_bal, details_t(*last_xact));
#endif
cur_bal.round();
#if 0
// jww (2008-04-24): What does this do?
last_xact->xdata().date = 0;
#endif
cur_bal = total_expr.calc(*last_xact).round();
if (value_t diff = cur_bal - last_balance) {
entry_temps.push_back(entry_t());
@ -341,12 +333,8 @@ void changed_value_xacts::operator()(xact_t& xact)
item_handler<xact_t>::operator()(xact);
#if 0
compute_total(last_balance, details_t(xact));
#endif
last_balance.round();
last_xact = &xact;
last_balance = total_expr.calc(xact).round();
last_xact = &xact;
}
void component_xacts::operator()(xact_t& xact)
@ -355,10 +343,9 @@ void component_xacts::operator()(xact_t& xact)
if (xact.has_xdata() &&
xact.xdata().has_component_xacts())
#if 0
xact.xdata().walk_component_xacts(*handler);
#else
;
xact.xdata().walk_component_xacts(*handler)
#endif
;
else
(*handler)(xact);
}

View file

@ -366,6 +366,7 @@ class changed_value_xacts : public item_handler<xact_t>
// This filter requires that calc_xacts be used at some point
// later in the chain.
expr_t total_expr;
bool changed_values_only;
xact_t * last_xact;
value_t last_balance;
@ -377,8 +378,9 @@ class changed_value_xacts : public item_handler<xact_t>
public:
changed_value_xacts(xact_handler_ptr handler,
bool _changed_values_only)
: item_handler<xact_t>(handler),
const expr_t& _total_expr,
bool _changed_values_only)
: item_handler<xact_t>(handler), total_expr(_total_expr),
changed_values_only(_changed_values_only), last_xact(NULL) {
TRACE_CTOR(changed_value_xacts,
"xact_handler_ptr, bool");