Merge remote branch 'origin/master' into psppsheet
[pspp] / src / ui / gui / find-dialog.c
index 1f929b6485f88e5071d79bddb54e8b5c5044f7a8..1a3a0a5c91afcfeb70067d2e29bf56887880eba6 100644 (file)
@@ -49,9 +49,6 @@ which match particular strings */
 #define N_(msgid) msgid
 
 
-/* FIXME: These shouldn't be here */
-#include "psppire-var-store.h"
-
 struct find_dialog
 {
   GtkBuilder *xml;
@@ -122,7 +119,7 @@ do_find (GObject *obj, const struct find_dialog *fd)
                                     PSPPIRE_DATA_EDITOR_DATA_VIEW);
 
       psppire_data_sheet_goto_case (data_sheet, x);
-      psppire_data_sheet_show_variable (data_sheet, column);
+      psppire_data_sheet_goto_variable (data_sheet, column);
     }
 
 }
@@ -196,7 +193,6 @@ find_dialog (PsppireDataWindow *de)
 
   GtkWidget *buttonbox;
 
-  PsppireVarStore *vs ;
   PsppireDataStore *ds ;
 
   fd.xml = builder_new ("find.ui");
@@ -215,12 +211,10 @@ find_dialog (PsppireDataWindow *de)
   selector = get_widget_assert (fd.xml, "find-selector");
 
   g_object_get (de->data_editor,
-               "var-store", &vs,
+               "dictionary", &fd.dict,
                "data-store", &ds,
                NULL);
 
-  g_object_get (vs, "dictionary", &fd.dict, NULL);
-
   fd.data = ds->datasheet;
 
   fd.variable_entry        = get_widget_assert (fd.xml, "find-variable-entry");
@@ -471,8 +465,13 @@ string_label_compare (const struct comparator *cmptr,
   const struct string_comparator *ssc =
     (const struct string_comparator *) cmptr;
 
+  int width;
+
   const char *text = var_lookup_value_label (cmptr->var, val);
-  int width = strlen (text);
+  if (text == NULL)
+    return false;
+
+  width = strlen (text);
 
   assert ( cmptr->flags & STR_CMP_LABELS);