From db663a298eeacc9ddedcf363a5229d73ca8b9784 Mon Sep 17 00:00:00 2001 From: Robert Fewell <14uBobIT@gmail.com> Date: Thu, 20 Dec 2018 14:36:11 +0000 Subject: [PATCH] If you use the autocomplete and cancel other registers are not refreshed When the autocomplete is used the blank transaction gets the copy of the originating transaction and if you decide to cancel this any other open register that had a split in the new transaction is left with blank rows where the transaction was. Add a test for the pending and blank transaction being equal and refresh all registers if so. --- gnucash/register/ledger-core/split-register.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/gnucash/register/ledger-core/split-register.c b/gnucash/register/ledger-core/split-register.c index c874365c51..575c621c1a 100644 --- a/gnucash/register/ledger-core/split-register.c +++ b/gnucash/register/ledger-core/split-register.c @@ -1365,11 +1365,17 @@ void gnc_split_register_cancel_cursor_trans_changes (SplitRegister *reg) { SRInfo *info = gnc_split_register_get_info (reg); - Transaction *pending_trans; + Transaction *pending_trans, *blank_trans; + gboolean refresh_all = FALSE; pending_trans = xaccTransLookup (&info->pending_trans_guid, gnc_get_current_book ()); + blank_trans = xaccSplitGetParent (gnc_split_register_get_blank_split (reg)); + + if (pending_trans == blank_trans) + refresh_all = TRUE; + /* Get the currently open transaction, rollback the edits on it, and * then repaint everything. To repaint everything, make a note of * all of the accounts that will be affected by this rollback. */ @@ -1389,7 +1395,11 @@ gnc_split_register_cancel_cursor_trans_changes (SplitRegister *reg) info->pending_trans_guid = *guid_null (); gnc_resume_gui_refresh (); - gnc_split_register_redraw(reg); + + if (refresh_all) + gnc_gui_refresh_all (); // force a refresh of all registers + else + gnc_split_register_redraw (reg); } void