From cf587c12349dee27d1105628a35b70cf623a2401 Mon Sep 17 00:00:00 2001 From: Robert Fewell <14uBobIT@gmail.com> Date: Mon, 15 Oct 2018 11:33:12 +0100 Subject: [PATCH] Do not destroy the 'blank split' With a register in journal mode and you use the 'move to blank transaction' button which puts the cursor in the 'blank split' and then immediately click on another transaction you loose the ability to add any more transactions using the blank transaction as there is no 'blank split'. Test for the old_split being the 'blank split' before destroying. --- .../ledger-core/split-register-control.c | 27 ++++++++++--------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/gnucash/register/ledger-core/split-register-control.c b/gnucash/register/ledger-core/split-register-control.c index 0bb8ebeddc..129e051324 100644 --- a/gnucash/register/ledger-core/split-register-control.c +++ b/gnucash/register/ledger-core/split-register-control.c @@ -453,18 +453,21 @@ gnc_split_register_move_cursor (VirtualLocation *p_new_virt_loc, (old_split != new_split) && gnc_split_register_old_split_empty_p(reg, old_split)) { - int current_row; - - xaccSplitDestroy(old_split); - old_split = NULL; - - /* - * If the user is moving down a row, we've just thrown off the - * numbers by deleting a split. Correct for that. - */ - current_row = reg->table->current_cursor_loc.vcell_loc.virt_row; - if (new_virt_loc.vcell_loc.virt_row > current_row) - new_virt_loc.vcell_loc.virt_row--; + if (old_split != gnc_split_register_get_blank_split (reg)) + { + int current_row; + + xaccSplitDestroy(old_split); + old_split = NULL; + + /* + * If the user is moving down a row, we've just thrown off the + * numbers by deleting a split. Correct for that. + */ + current_row = reg->table->current_cursor_loc.vcell_loc.virt_row; + if (new_virt_loc.vcell_loc.virt_row > current_row) + new_virt_loc.vcell_loc.virt_row--; + } } else if ((pending_trans != NULL) && (pending_trans == old_trans) &&