gnucash master: Multiple changes pushed

John Ralls jralls at code.gnucash.org
Fri Jun 5 15:13:27 EDT 2020


Updated	 via  https://github.com/Gnucash/gnucash/commit/e4e36e68 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/cee479f4 (commit)
	from  https://github.com/Gnucash/gnucash/commit/153ee887 (commit)



commit e4e36e684360c328fe2a1156c367509efc336c95
Author: John Ralls <jralls at ceridwen.us>
Date:   Fri Jun 5 12:06:23 2020 -0700

    Bug 797781 - Num Field Regression - characters in wrong order when typed.

diff --git a/gnucash/register/register-gnome/gnucash-sheet.c b/gnucash/register/register-gnome/gnucash-sheet.c
index 27b5d20bc..f70f01269 100644
--- a/gnucash/register/register-gnome/gnucash-sheet.c
+++ b/gnucash/register/register-gnome/gnucash-sheet.c
@@ -991,7 +991,10 @@ make_new_text (GnucashSheet *sheet, const char* new_text, int *position)
     int insert_length = g_utf8_strlen (new_text, -1);
 
     if (!old_text || old_length == 0)
+    {
+        *position = insert_length;
         return g_strdup(new_text);
+    }
 
     gtk_editable_get_selection_bounds (editable, &bound, &pos);
     normalize_selection_bounds (&pos, &bound, old_length);

commit cee479f4f42ad75e1c42f81639606748b03d7ec3
Author: John Ralls <jralls at ceridwen.us>
Date:   Fri Jun 5 11:01:24 2020 -0700

    Gnucash-sheet: Add debug statements for tracking selection.

diff --git a/gnucash/register/register-gnome/gnucash-sheet.c b/gnucash/register/register-gnome/gnucash-sheet.c
index fb688994a..27b5d20bc 100644
--- a/gnucash/register/register-gnome/gnucash-sheet.c
+++ b/gnucash/register/register-gnome/gnucash-sheet.c
@@ -69,7 +69,7 @@ enum
 /** Static Globals *****************************************************/
 
 /* This static indicates the debugging module that this .o belongs to. */
-static QofLogModule log_module = GNC_MOD_REGISTER;
+static QofLogModule log_module = G_LOG_DOMAIN;
 static GtkLayout *sheet_parent_class;
 
 
@@ -103,6 +103,7 @@ gboolean gnucash_sheet_draw_cb (GtkWidget *widget, cairo_t *cr,
 static inline void
 gnucash_sheet_set_entry_selection (GnucashSheet *sheet)
 {
+    DEBUG ("Set entry selection to sheet: %d:%d", sheet->bound, sheet->pos);
     gtk_editable_select_region (GTK_EDITABLE (sheet->entry),
                                 sheet->bound, sheet->pos);
 }
@@ -117,6 +118,7 @@ gnucash_sheet_set_selection_from_entry (GnucashSheet *sheet)
 static inline void
 gnucash_sheet_set_selection (GnucashSheet *sheet, int pos, int bound)
 {
+    DEBUG ("Set sheet selection %d:%d", bound, pos);
     sheet->pos = pos;
     sheet->bound = bound;
     gnucash_sheet_set_entry_selection (sheet);
@@ -892,6 +894,7 @@ gnucash_sheet_modify_current_cell (GnucashSheet *sheet, const gchar *new_text)
 
     if (retval)
     {
+        DEBUG ("%s", retval ? retval : "nothing");
         gnucash_sheet_set_entry_value (sheet, retval);
         gnucash_sheet_set_position_and_selection (sheet, cursor_position,
                                                   start_sel, end_sel);
@@ -943,6 +946,7 @@ gnucash_sheet_direct_event(GnucashSheet *sheet, GdkEvent *event)
                                       event);
     if (result)
     {
+        DEBUG ("%s", new_text ? new_text : "nothing");
         if (new_text != NULL)
             gnucash_sheet_set_entry_value (sheet, new_text);
         gnucash_sheet_set_position_and_selection (sheet, new_position,
@@ -1071,6 +1075,7 @@ gnucash_sheet_insert_cb (GtkEditable *editable,
          * IMContext that would reset the selection, and we may need to keep it
          * so save it in the sheet values.
          */
+        DEBUG ("%s, got %s", new_text, retval);
         gnucash_sheet_set_position_and_selection (sheet, *position, start_sel,
                                                   end_sel);
 
@@ -1169,6 +1174,7 @@ gnucash_sheet_delete_cb (GtkWidget *widget,
                                         "delete_text");
     }
 
+    DEBUG ("%s", retval ? retval : "nothing");
     gnucash_sheet_set_position_and_selection (sheet, cursor_position,
                                               start_sel, end_sel);
 }



Summary of changes:
 gnucash/register/register-gnome/gnucash-sheet.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)



More information about the gnucash-changes mailing list