X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=src%2Fui%2Fgui%2Fpsppire-data-sheet.c;h=e1ecbbb924a005bd0646c62a3558765965814fa1;hb=refs%2Fbuilds%2F20130116032122%2Fpspp;hp=6714bfb90ef1b29998dc2dafb8aeeb9b3fcf159e;hpb=9d1bfb34842de4a129140622ee3d800297c0e69d;p=pspp diff --git a/src/ui/gui/psppire-data-sheet.c b/src/ui/gui/psppire-data-sheet.c index 6714bfb90e..e1ecbbb924 100644 --- a/src/ui/gui/psppire-data-sheet.c +++ b/src/ui/gui/psppire-data-sheet.c @@ -1047,7 +1047,7 @@ psppire_data_sheet_find_column_for_variable (PsppireDataSheet *data_sheet, } void -psppire_data_sheet_show_variable (PsppireDataSheet *data_sheet, +psppire_data_sheet_goto_variable (PsppireDataSheet *data_sheet, gint dict_index) { PsppSheetView *sheet_view = PSPP_SHEET_VIEW (data_sheet); @@ -1056,8 +1056,17 @@ psppire_data_sheet_show_variable (PsppireDataSheet *data_sheet, column = psppire_data_sheet_find_column_for_variable (data_sheet, dict_index); if (column != NULL) - pspp_sheet_view_scroll_to_cell (sheet_view, NULL, column, - FALSE, 0.0, 0.0); + { + GtkTreePath *path; + + gint row = psppire_data_sheet_get_current_case (data_sheet); + path = gtk_tree_path_new_from_indices (row >= 0 ? row : 0, -1); + + pspp_sheet_view_scroll_to_cell (sheet_view, path, column, + FALSE, 0.0, 0.0); + pspp_sheet_view_set_cursor (sheet_view, path, column, FALSE); + gtk_tree_path_free (path); + } } struct variable *