pspp-sheet-view: Fix warning using arrow keys to navigate column buttons. 20121029032029/pspp 20121030031955/pspp 20121031031956/pspp 20121101032031/pspp 20121102032007/pspp 20121103032004/pspp 20121104032009/pspp 20121105032017/pspp 20121106032209/pspp 20121107031955/pspp 20121108032020/pspp
authorBen Pfaff <blp@cs.stanford.edu>
Sun, 28 Oct 2012 20:22:33 +0000 (13:22 -0700)
committerBen Pfaff <blp@cs.stanford.edu>
Sun, 28 Oct 2012 20:22:33 +0000 (13:22 -0700)
Before this commit, clicking on a column head button in the data sheet,
then holding down the right arrow key until the data sheet began to scroll
right would often produce a warning of the form:

** (psppire:16451): WARNING **: Internal button not found

because nothing caused the underlying GtkButton to be instantiated in this
scenario.  This commit fixes the problem.

src/ui/gui/pspp-sheet-view.c

index 9dbec5916b364507f24069e1fb7bf8b34010775e..38c609669c4f292412278e4852c7b16d27406db0 100644 (file)
@@ -6712,13 +6712,16 @@ pspp_sheet_view_header_focus (PsppSheetView      *tree_view,
              break;
            }
          column = tmp_list->data;
-         if (column->button &&
-             column->visible &&
+          if (column->visible &&
              pspp_sheet_view_column_can_focus (column))
-           {
-              pspp_sheet_view_focus_column (tree_view, column,
-                                            clamp_column_visible);
-              return TRUE;
+            {
+              pspp_sheet_view_column_set_need_button (column, TRUE);
+              if (column->button)
+                {
+                  pspp_sheet_view_focus_column (tree_view, column,
+                                                clamp_column_visible);
+                  return TRUE;
+                }
            }
        }
       return FALSE;