diff options
author | John Wiegley <johnw@newartisans.com> | 2012-04-15 01:17:01 -0500 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2012-04-15 01:17:01 -0500 |
commit | ee641f353c9a2216533800464d26afe86f1b028e (patch) | |
tree | 2f7b290d5e6ea5c395ff294d4c911a4f942fe6f6 /src | |
parent | 1ad826c2bccabad844156a181735dd960f87d174 (diff) | |
download | fork-ledger-ee641f353c9a2216533800464d26afe86f1b028e.tar.gz fork-ledger-ee641f353c9a2216533800464d26afe86f1b028e.tar.bz2 fork-ledger-ee641f353c9a2216533800464d26afe86f1b028e.zip |
Resolve some issues with proof builds
Diffstat (limited to 'src')
-rw-r--r-- | src/draft.cc | 14 | ||||
-rw-r--r-- | src/draft.h | 9 | ||||
-rw-r--r-- | src/xact.cc | 3 |
3 files changed, 18 insertions, 8 deletions
diff --git a/src/draft.cc b/src/draft.cc index 7edf7edc..43c214cb 100644 --- a/src/draft.cc +++ b/src/draft.cc @@ -507,7 +507,6 @@ value_t template_command(call_scope_t& args) out << std::endl << std::endl; draft_t draft(args.value()); - out << _("--- Transaction template ---") << std::endl; draft.dump(out); @@ -517,15 +516,16 @@ value_t template_command(call_scope_t& args) value_t xact_command(call_scope_t& args) { report_t& report(find_scope<report_t>(args)); - draft_t draft(args.value()); + draft_t draft(args.value()); - xact_t * new_xact = draft.insert(*report.session.journal.get()); + unique_ptr<xact_t> new_xact(draft.insert(*report.session.journal.get())); + if (new_xact.get()) { + // Only consider actual postings for the "xact" command + report.HANDLER(limit_).on("#xact", "actual"); - // Only consider actual postings for the "xact" command - report.HANDLER(limit_).on("#xact", "actual"); + report.xact_report(post_handler_ptr(new print_xacts(report)), *new_xact.get()); + } - if (new_xact) - report.xact_report(post_handler_ptr(new print_xacts(report)), *new_xact); return true; } diff --git a/src/draft.h b/src/draft.h index 46aa26e1..9023e6da 100644 --- a/src/draft.h +++ b/src/draft.h @@ -81,6 +81,15 @@ class draft_t : public expr_base_t<value_t> xact_template_t() { TRACE_CTOR(xact_template_t, ""); } + xact_template_t(const xact_template_t& other) + : date(other.date), + code(other.code), + note(other.note), + payee_mask(other.payee_mask), + posts(other.posts) + { + TRACE_CTOR(xact_template_t, "copy"); + } ~xact_template_t() throw() { TRACE_DTOR(xact_template_t); } diff --git a/src/xact.cc b/src/xact.cc index 3f4b753c..226fd5ab 100644 --- a/src/xact.cc +++ b/src/xact.cc @@ -56,7 +56,8 @@ xact_base_t::~xact_base_t() // temporary is. assert(! post->has_flags(ITEM_TEMP)); - post->account->remove_post(post); + if (post->account) + post->account->remove_post(post); checked_delete(post); } } |