New file: builder-wrapper.h and builder-wrapper.c
[pspp-builds.git] / src / ui / gui / val-labs-dialog.c
index 150dcd54ef39bc1225480c14e9d4a5332346325a..6b556d6de7861baa006530b2cfcf943fe0ff46d9 100644 (file)
@@ -1,5 +1,5 @@
 /* PSPPIRE - a graphical user interface for PSPP.
-   Copyright (C) 2005, 2009, 2010, 2011  Free Software Foundation
+   Copyright (C) 2005, 2009, 2010, 2011, 2012  Free Software Foundation
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -22,7 +22,7 @@
 
 #include <string.h>
 
-#include "helper.h"
+#include "builder-wrapper.h"
 #include "val-labs-dialog.h"
 #include <data/value-labels.h>
 #include <data/format.h>
@@ -30,6 +30,8 @@
 #include "psppire-var-store.h"
 #include <libpspp/i18n.h>
 
+#include "helper.h"
+
 #include <gettext.h>
 #define _(msgid) gettext (msgid)
 #define N_(msgid) msgid
@@ -38,9 +40,6 @@ struct val_labs_dialog
 {
   GtkWidget *window;
 
-  PsppireVarStore *var_store;
-  PsppireDict *dict;
-
   /* The variable to be updated */
   struct variable *pv;
 
@@ -356,7 +355,7 @@ on_select_row (GtkTreeView *treeview, gpointer data)
   gchar *text;
 
   get_selected_tuple (dialog, &value, &label);
-  text = value_to_text (value, dialog->dict, *var_get_print_format (dialog->pv));
+  text = value_to_text (value, dialog->pv);
 
   g_signal_handler_block (GTK_ENTRY (dialog->value_entry),
                         dialog->value_handler_id);
@@ -385,7 +384,7 @@ on_select_row (GtkTreeView *treeview, gpointer data)
 /* Create a new dialog box
    (there should  normally be only one)*/
 struct val_labs_dialog *
-val_labs_dialog_create (GtkWindow *toplevel, PsppireVarStore *var_store)
+val_labs_dialog_create (GtkWindow *toplevel)
 {
   GtkTreeViewColumn *column;
 
@@ -395,8 +394,6 @@ val_labs_dialog_create (GtkWindow *toplevel, PsppireVarStore *var_store)
 
   struct val_labs_dialog *dialog = g_malloc (sizeof (*dialog));
 
-  dialog->var_store = var_store;
-  g_object_get (var_store, "dictionary", &dialog->dict, NULL);
   dialog->window = get_widget_assert (xml,"val_labs_dialog");
   dialog->value_entry = get_widget_assert (xml,"value_entry");
   dialog->label_entry = get_widget_assert (xml,"label_entry");
@@ -509,8 +506,7 @@ repopulate_dialog (struct val_labs_dialog *dialog)
       const struct val_lab *vl = labels[i];
 
       gchar *const vstr  =
-       value_to_text (vl->value, dialog->dict,
-                     *var_get_print_format (dialog->pv));
+       value_to_text (vl->value, dialog->pv);
 
       gchar *const text = g_strdup_printf (_("%s = `%s'"), vstr,
                                            val_lab_get_escaped_label (vl));