gui: Fix temporary filtering by a variable's value.
authorBen Pfaff <blp@cs.stanford.edu>
Sat, 14 May 2011 03:56:05 +0000 (20:56 -0700)
committerBen Pfaff <blp@cs.stanford.edu>
Sat, 14 May 2011 03:56:09 +0000 (20:56 -0700)
Problem reported by Mindaugus.
Bug #33088.

src/ui/gui/select-cases-dialog.c

index c5a7fa72c23835ad09d864f97f0200dd0107771f..381fc3dd8a104649404358b1abb5a7f4a7f08735 100644 (file)
@@ -366,7 +366,7 @@ generate_syntax_filter (const struct select_cases_dialog *scd)
   gchar *text = NULL;
   GString *string = g_string_new ("");
 
-  const gchar filter[]="filter_$";
+  const gchar *filter = "filter_$";
   const gchar key[]="case_$";
 
   if ( gtk_toggle_button_get_active
@@ -462,6 +462,13 @@ generate_syntax_filter (const struct select_cases_dialog *scd)
       g_string_append (string, "EXECUTE.\n");
 
     }
+  else
+    {
+      GtkEntry *entry =
+       GTK_ENTRY (get_widget_assert (scd->xml,
+                                     "filter-variable-entry"));
+      filter = gtk_entry_get_text (entry);
+    }
 
 
   g_string_append_printf  (string, "FILTER BY %s.\n", filter);