diff options
Diffstat (limited to 'journal.h')
-rw-r--r-- | journal.h | 32 |
1 files changed, 4 insertions, 28 deletions
@@ -44,12 +44,10 @@ class transaction_t state_t state; unsigned short flags; std::string note; -#ifdef USE_EDITOR istream_pos_type beg_pos; unsigned long beg_line; istream_pos_type end_pos; unsigned long end_line; -#endif mutable void * data; static bool use_effective_date; @@ -58,13 +56,9 @@ class transaction_t : entry(NULL), _date(0), _date_eff(0), account(_account), amount_expr(NULL), cost(NULL), cost_expr(NULL), state(UNCLEARED), flags(TRANSACTION_NORMAL), -#ifdef USE_EDITOR - beg_pos(0), beg_line(0), end_pos(0), end_line(0), -#endif - data(NULL) { + beg_pos(0), beg_line(0), end_pos(0), end_line(0), data(NULL) { DEBUG_PRINT("ledger.memory.ctors", "ctor transaction_t"); } - transaction_t(account_t * _account, const amount_t& _amount, unsigned int _flags = TRANSACTION_NORMAL, @@ -72,30 +66,18 @@ class transaction_t : entry(NULL), _date(0), _date_eff(0), account(_account), amount(_amount), amount_expr(NULL), cost(NULL), cost_expr(NULL), state(UNCLEARED), flags(_flags), note(_note), -#ifdef USE_EDITOR - beg_pos(0), beg_line(0), end_pos(0), end_line(0), -#endif - data(NULL) { + beg_pos(0), beg_line(0), end_pos(0), end_line(0), data(NULL) { DEBUG_PRINT("ledger.memory.ctors", "ctor transaction_t"); } - transaction_t(const transaction_t& xact) : entry(xact.entry), _date(0), _date_eff(0), account(xact.account), amount(xact.amount), amount_expr(NULL), cost(xact.cost ? new amount_t(*xact.cost) : NULL), cost_expr(NULL), state(xact.state), flags(xact.flags), note(xact.note), -#ifdef USE_EDITOR - beg_pos(0), beg_line(0), end_pos(0), end_line(0), -#endif - data(NULL) { + beg_pos(0), beg_line(0), end_pos(0), end_line(0), data(NULL) { DEBUG_PRINT("ledger.memory.ctors", "ctor transaction_t"); } - - ~transaction_t() { - DEBUG_PRINT("ledger.memory.dtors", "dtor transaction_t"); - if (cost) - delete cost; - } + ~transaction_t(); std::time_t actual_date() const; std::time_t effective_date() const; @@ -124,26 +106,20 @@ class entry_base_t { public: journal_t * journal; -#ifdef USE_EDITOR unsigned long src_idx; istream_pos_type beg_pos; unsigned long beg_line; istream_pos_type end_pos; unsigned long end_line; -#endif transactions_list transactions; entry_base_t() : journal(NULL), -#ifdef USE_EDITOR beg_pos(0), beg_line(0), end_pos(0), end_line(0) -#endif { DEBUG_PRINT("ledger.memory.ctors", "ctor entry_base_t"); } entry_base_t(const entry_base_t& e) : journal(NULL), -#ifdef USE_EDITOR beg_pos(0), beg_line(0), end_pos(0), end_line(0) -#endif { DEBUG_PRINT("ledger.memory.ctors", "ctor entry_base_t"); for (transactions_list::const_iterator i = e.transactions.begin(); |