gui: Redo var sheet, data sheet, text import with PsppSheetView.
[pspp] / src / ui / gui / find-dialog.c
index 0f856f94629d29c58383d9a1fc3d078015b47bf4..1f929b6485f88e5071d79bddb54e8b5c5044f7a8 100644 (file)
@@ -20,28 +20,29 @@ which match particular strings */
 
 #include <config.h>
 
-#include "find-dialog.h"
-#include "psppire-selector.h"
-#include "psppire-dialog.h"
-#include "builder-wrapper.h"
-#include "helper.h"
-#include "psppire-data-window.h"
-#include "dict-display.h"
-#include <data/value.h>
-#include <data/format.h>
-#include <data/datasheet.h>
-#include <data/data-in.h>
-#include "psppire-data-store.h"
 #include <ctype.h>
-#include <sys/types.h>
-#include <regex.h>
-#include <libpspp/cast.h>
-#include <libpspp/message.h>
-
 #include <gtk/gtk.h>
+#include <regex.h>
 #include <stdlib.h>
+#include <sys/types.h>
 
-#include "xalloc.h"
+#include "data/data-in.h"
+#include "data/datasheet.h"
+#include "data/format.h"
+#include "data/value.h"
+#include "libpspp/cast.h"
+#include "libpspp/message.h"
+#include "ui/gui/builder-wrapper.h"
+#include "ui/gui/dict-display.h"
+#include "ui/gui/find-dialog.h"
+#include "ui/gui/helper.h"
+#include "ui/gui/psppire-data-sheet.h"
+#include "ui/gui/psppire-data-store.h"
+#include "ui/gui/psppire-data-window.h"
+#include "ui/gui/psppire-dialog.h"
+#include "ui/gui/psppire-selector.h"
+
+#include "gl/xalloc.h"
 
 #include <gettext.h>
 #define _(msgid) gettext (msgid)
@@ -102,12 +103,13 @@ refresh (GObject *obj, const struct find_dialog *fd)
 static void
 do_find (GObject *obj, const struct find_dialog *fd)
 {
+  PsppireDataSheet *data_sheet;
   casenumber x = -1;
   gint column = -1;
   glong row;
 
-  g_object_get (fd->de->data_editor, "current-case", &row, NULL);
-
+  data_sheet = psppire_data_editor_get_active_data_sheet (fd->de->data_editor);
+  row = psppire_data_sheet_get_selected_case (data_sheet);
   if ( row < 0 )
     row = 0;
 
@@ -119,10 +121,8 @@ do_find (GObject *obj, const struct find_dialog *fd)
       gtk_notebook_set_current_page (GTK_NOTEBOOK (fd->de->data_editor),
                                     PSPPIRE_DATA_EDITOR_DATA_VIEW);
 
-      g_object_set (fd->de->data_editor,
-                   "current-case", x,
-                   "current-variable", column,
-                   NULL);
+      psppire_data_sheet_goto_case (data_sheet, x);
+      psppire_data_sheet_show_variable (data_sheet, column);
     }
 
 }