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.
pull/432/head
Robert Fewell 8 years ago
parent 60f184be92
commit cf587c1234

@ -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) &&

Loading…
Cancel
Save