Make the goto variable feature work again
authorJohn Darrington <john@darrington.wattle.id.au>
Tue, 4 Apr 2017 09:24:22 +0000 (11:24 +0200)
committerJohn Darrington <john@darrington.wattle.id.au>
Tue, 4 Apr 2017 09:24:22 +0000 (11:24 +0200)
src/ui/gui/psppire-data-editor.c

index 27d2f140991eaf220dbcae2b2a4a2ae64e682fea..824b3c02b001cab9b8ef73f039f689b38dc30b14 100644 (file)
@@ -1110,4 +1110,17 @@ psppire_data_editor_split_window (PsppireDataEditor *de, gboolean split)
 void
 psppire_data_editor_goto_variable (PsppireDataEditor *de, gint dict_index)
 {
+  gint page = gtk_notebook_get_current_page (GTK_NOTEBOOK (de));
+
+  switch (page)
+    {
+      case PSPPIRE_DATA_EDITOR_DATA_VIEW:
+       jmd_sheet_scroll_to (JMD_SHEET (de->data_sheet), dict_index, -1);
+       jmd_sheet_set_active_cell (JMD_SHEET (de->data_sheet), dict_index, -1, NULL);
+       break;
+      case PSPPIRE_DATA_EDITOR_VARIABLE_VIEW:
+       jmd_sheet_scroll_to (JMD_SHEET (de->var_sheet), -1, dict_index);
+       jmd_sheet_set_active_cell (JMD_SHEET (de->var_sheet), -1, dict_index, NULL);
+       break;
+    }
 }