From 1a94c52db0669abef3586561c470475286cde1e8 Mon Sep 17 00:00:00 2001 From: Chris Shoemaker Date: Thu, 27 Apr 2006 03:27:46 +0000 Subject: [PATCH] Address bug #339288: When deleting a split, ensure the transaction is open for editing, an redraw the display afterward. git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13865 57a11ea4-9604-0410-9ed3-97b8803252fd --- src/register/ledger-core/split-register.c | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/src/register/ledger-core/split-register.c b/src/register/ledger-core/split-register.c index e217630bc8c..cd0f6b086b7 100644 --- a/src/register/ledger-core/split-register.c +++ b/src/register/ledger-core/split-register.c @@ -798,7 +798,6 @@ gnc_split_register_delete_current_split (SplitRegister *reg) Transaction *pending_trans; Transaction *trans; Split *blank_split; - Account *account; Split *split; if (!reg) return; @@ -825,23 +824,21 @@ gnc_split_register_delete_current_split (SplitRegister *reg) gnc_suspend_gui_refresh (); - /* make a copy of all of the accounts that will be - * affected by this deletion, so that we can update - * their register windows after the deletion. */ trans = xaccSplitGetParent(split); - account = xaccSplitGetAccount (split); - - xaccSplitDestroy (split); - /* Check pending transaction */ - if (trans == pending_trans) - { - info->pending_trans_guid = *guid_null (); - pending_trans = NULL; + if (trans == pending_trans) { + g_assert(xaccTransIsOpen(trans)); + } else { + g_assert(!pending_trans); + g_assert(!xaccTransIsOpen(trans)); + xaccTransBeginEdit(trans); + info->pending_trans_guid = *xaccTransGetGUID(trans); } + xaccSplitDestroy (split); gnc_resume_gui_refresh (); + gnc_split_register_redraw(reg); } void