summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/chain.cc3
-rw-r--r--src/filters.cc8
-rw-r--r--src/filters.h15
3 files changed, 13 insertions, 13 deletions
diff --git a/src/chain.cc b/src/chain.cc
index 68577dcb..b1749909 100644
--- a/src/chain.cc
+++ b/src/chain.cc
@@ -115,7 +115,8 @@ xact_handler_ptr chain_xact_handlers(report_t& report,
// weekly or monthly.
if (report.HANDLED(period_)) {
handler.reset(new interval_xacts(handler, expr,
- report.HANDLER(period_).str()));
+ report.HANDLER(period_).str(),
+ report.session.master.get()));
handler.reset(new sort_xacts(handler, "date"));
}
}
diff --git a/src/filters.cc b/src/filters.cc
index ca6397a8..f97e58d0 100644
--- a/src/filters.cc
+++ b/src/filters.cc
@@ -493,11 +493,13 @@ void interval_xacts::operator()(xact_t& xact)
// Generate a null transaction, so the intervening periods can be seen
// when -E is used, or if the calculated amount ends up being non-zero
- account_t empty_account(NULL, "<Empty>");
- entry_t null_entry;
+ entry_temps.push_back(entry_t());
+ entry_t& null_entry = entry_temps.back();
null_entry.add_flags(ITEM_TEMP);
null_entry._date = quant;
- xact_t null_xact(&empty_account);
+
+ xact_temps.push_back(xact_t(&empty_account));
+ xact_t& null_xact = xact_temps.back();
null_xact.add_flags(ITEM_TEMP);
null_xact.amount = 0L;
null_entry.add_xact(&null_xact);
diff --git a/src/filters.h b/src/filters.h
index d5db3b6c..2adfbbb7 100644
--- a/src/filters.h
+++ b/src/filters.h
@@ -570,23 +570,20 @@ class interval_xacts : public subtotal_xacts
xact_t * last_xact;
bool started;
+ std::list<entry_t> entry_temps;
+ std::list<xact_t> xact_temps;
+ account_t empty_account;
+
interval_xacts();
public:
interval_xacts(xact_handler_ptr _handler, expr_t& amount_expr,
- const interval_t& _interval)
+ const interval_t& _interval, account_t * master = NULL)
: subtotal_xacts(_handler, amount_expr), interval(_interval),
- last_xact(NULL), started(false) {
+ last_xact(NULL), started(false), empty_account(master, "<Empty>") {
TRACE_CTOR(interval_xacts,
"xact_handler_ptr, const interval_t&, bool");
}
- interval_xacts(xact_handler_ptr _handler, expr_t& amount_expr,
- const string& _interval)
- : subtotal_xacts(_handler, amount_expr), interval(_interval),
- last_xact(NULL), started(false) {
- TRACE_CTOR(interval_xacts,
- "xact_handler_ptr, const string&, bool");
- }
virtual ~interval_xacts() throw() {
TRACE_DTOR(interval_xacts);
}