gnucash maint: Fix register tooltip crash

Robert Fewell bobit at code.gnucash.org
Tue Jul 30 10:13:49 EDT 2019


Updated	 via  https://github.com/Gnucash/gnucash/commit/19114cc1 (commit)
	from  https://github.com/Gnucash/gnucash/commit/db93aec5 (commit)



commit 19114cc111d5a685a31ff121a74a82d1d528275d
Author: Robert Fewell <14uBobIT at gmail.com>
Date:   Tue Jul 30 14:55:59 2019 +0100

    Fix register tooltip crash
    
    When the register is in double line mode, a tooltip for the transaction
    association column can be shown if one is present by hovering the mouse
    over the cell. If the register 'cursor' is highlighting any transaction
    row this works but if the 'cursor' is on a split and mouse moves to an
    association cell with an entry, Gnucash will crash. To fix this use the
    SheetBlockStyle from block instead of the GnucashCursor.

diff --git a/gnucash/register/register-gnome/gnucash-sheet.c b/gnucash/register/register-gnome/gnucash-sheet.c
index 683455b6c..7de2f0e10 100644
--- a/gnucash/register/register-gnome/gnucash-sheet.c
+++ b/gnucash/register/register-gnome/gnucash-sheet.c
@@ -2676,7 +2676,6 @@ gnucash_sheet_tooltip (GtkWidget  *widget, gint x, gint y,
                gpointer    user_data)
 {
     GnucashSheet *sheet = GNUCASH_SHEET (widget);
-    GnucashCursor *cursor = sheet->cursor;
     Table *table = sheet->table;
     VirtualLocation virt_loc;
     gchar *tooltip_text;
@@ -2716,7 +2715,7 @@ gnucash_sheet_tooltip (GtkWidget  *widget, gint x, gint y,
     by = block->origin_y;
 
     // get the cell location and dimensions
-    gnucash_sheet_style_get_cell_pixel_rel_coords (cursor->style,
+    gnucash_sheet_style_get_cell_pixel_rel_coords (block->style,
             virt_loc.phys_row_offset, virt_loc.phys_col_offset,
             &cx, &cy, &cw, &ch);
 



Summary of changes:
 gnucash/register/register-gnome/gnucash-sheet.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)



More information about the gnucash-changes mailing list