From 69dac5c1a74ce838125181ccbac7b6e61c2898ba Mon Sep 17 00:00:00 2001 From: Robert Fewell <14uBobIT@gmail.com> Date: Sun, 15 Sep 2024 10:43:43 +0100 Subject: [PATCH] Bug 799391 - Transaction Cut/Paste doesn't move the transaction to the target account Move the clearing of the 'copied_item' to before the setting of the 'copied_leader_guid'. This change is required due to a recent change to include resetting 'copied_leader_guid' in the 'clear_copied_item' function. --- gnucash/register/ledger-core/split-register.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/gnucash/register/ledger-core/split-register.c b/gnucash/register/ledger-core/split-register.c index 95e008e3fc6..ced855e4c72 100644 --- a/gnucash/register/ledger-core/split-register.c +++ b/gnucash/register/ledger-core/split-register.c @@ -98,6 +98,7 @@ clear_copied_item() gnc_float_txn_free (copied_item.ft); copied_item.ftype = 0; copied_item.fs = NULL; + copied_item.ft = NULL; copied_class = CURSOR_CLASS_NONE; copied_leader_guid = *guid_null(); } @@ -785,6 +786,9 @@ gnc_split_register_copy_current_internal (SplitRegister* reg, return; } + /* unprotect the old object, if any */ + clear_copied_item(); + /* Ok, we are now ready to make the copy. */ if (cursor_class == CURSOR_CLASS_SPLIT) @@ -834,9 +838,6 @@ gnc_split_register_copy_current_internal (SplitRegister* reg, return; } - /* unprotect the old object, if any */ - clear_copied_item(); - if (new_fs) { copied_item.fs = new_fs;