From dd5680c2674fe9ce458941ec9b3978cd7dda9bff Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Tue, 27 Jul 2004 01:33:41 -0400 Subject: reorganized report.cc into item.cc, expr.cc and format.cc --- constraint.cc | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'constraint.cc') diff --git a/constraint.cc b/constraint.cc index 1248c2b1..0af49502 100644 --- a/constraint.cc +++ b/constraint.cc @@ -1,9 +1,16 @@ #include "constraint.h" +#include "expr.h" #include namespace ledger { +constraints_t::~constraints_t() +{ + if (predicate) delete predicate; + if (sort_order) delete sort_order; +} + mask_t::mask_t(const std::string& pat) : exclude(false) { const char * p = pat.c_str(); @@ -183,14 +190,13 @@ bool constraints_t::operator ()(const entry_t * entry) const bool constraints_t::operator ()(const item_t * item) const { - if (predicate && ! predicate->compute(begin(), end(), item)) + if (predicate && ! predicate->compute(item, begin(), end())) return false; if (! matches_date_range(item->date)) return false; - if (! payee_masks.empty() && - ! (matches(payee_masks, item->payee))) + if (! payee_masks.empty() && ! matches(payee_masks, item->payee)) return false; #if 0 -- cgit v1.2.3