Bug 797971 - Inserting description text behaves oddly

This is best observed when trying to insert a character, say x when the
cursor is before the last character, the cursor will jump to the end
like... ABCD|E results in ABCDxE|

It can also affect when inserting/changing text that has come from the
quick fill the cursor may end up in the wrong place.

Changed a test condition to use the incoming new character length value
instead of the existing cell one.
This commit is contained in:
Robert Fewell 2020-10-15 15:21:05 +01:00
parent 06110e2abd
commit 190d5f1a61

View File

@ -198,7 +198,7 @@ gnc_quickfill_cell_modify_verify (BasicCell *_cell,
}
/* If we are inserting in the middle, just accept */
if (*cursor_position < _cell->value_chars)
if (*cursor_position < newval_chars)
{
gnc_basic_cell_set_value_internal (&cell->cell, newval);
gnc_quickfill_cell_set_original (cell, NULL);
@ -233,8 +233,6 @@ gnc_quickfill_cell_modify_verify (BasicCell *_cell,
if (cell->original != NULL)
newval = cell->original;
*cursor_position = -1;
gnc_basic_cell_set_value_internal (&cell->cell, newval);
return;
}