gnucash maint: Register: Don't double-delete when typing over a selection.

John Ralls jralls at code.gnucash.org
Tue Nov 24 17:53:42 EST 2020


Updated	 via  https://github.com/Gnucash/gnucash/commit/1bf863d9 (commit)
	from  https://github.com/Gnucash/gnucash/commit/a1c517b4 (commit)



commit 1bf863d9a1a033268bb65863b98553eb04510413
Author: John Ralls <jralls at ceridwen.us>
Date:   Tue Nov 24 14:53:34 2020 -0800

    Register: Don't double-delete when typing over a selection.
    
    In numcell or formulacell.

diff --git a/gnucash/register/register-core/formulacell.c b/gnucash/register/register-core/formulacell.c
index 76027d4b7..f5fbba6bd 100644
--- a/gnucash/register/register-core/formulacell.c
+++ b/gnucash/register/register-core/formulacell.c
@@ -151,6 +151,8 @@ gnc_formula_cell_modify_verify( BasicCell *_cell,
     if (change == NULL)
     {
         gnc_basic_cell_set_value_internal( &cell->cell, newval );
+        // Remove any selection.
+        *end_selection = *start_selection = *cursor_position;
         return;
     }
 
diff --git a/gnucash/register/register-core/numcell.c b/gnucash/register/register-core/numcell.c
index ff92adfbe..644462832 100644
--- a/gnucash/register/register-core/numcell.c
+++ b/gnucash/register/register-core/numcell.c
@@ -92,6 +92,8 @@ gnc_num_cell_modify_verify (BasicCell *_cell,
         /* then just accept the proposed change */
     {
         gnc_basic_cell_set_value_internal (&cell->cell, newval);
+        // Remove any selection.
+        *end_selection = *start_selection = *cursor_position;
         return;
     }
 



Summary of changes:
 gnucash/register/register-core/formulacell.c | 2 ++
 gnucash/register/register-core/numcell.c     | 2 ++
 2 files changed, 4 insertions(+)



More information about the gnucash-changes mailing list