X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fui%2Fgui%2Fvar-type-dialog.c;h=f196e554f9d0c224ee6bfc5a268814e566472050;hb=01b970b8972e4e457b1d8e3f5af350c325152942;hp=d93d88cf9afa79be6cad1e7ce985ad41a1dc0b55;hpb=ee04b8d031db0d7c405e3e9f00dcf8f038ee871e;p=pspp diff --git a/src/ui/gui/var-type-dialog.c b/src/ui/gui/var-type-dialog.c index d93d88cf9a..f196e554f9 100644 --- a/src/ui/gui/var-type-dialog.c +++ b/src/ui/gui/var-type-dialog.c @@ -1,5 +1,5 @@ /* PSPPIRE - a graphical user interface for PSPP. - Copyright (C) 2005, 2006 Free Software Foundation + Copyright (C) 2005, 2006, 2010 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 @@ -262,12 +262,12 @@ preview_custom (GtkWidget *w, gpointer data) union value v; v.f = 1234.56; - sample_text = value_to_text (v, NULL, dialog->fmt_l); + sample_text = value_to_text (v, dialog->vs->dictionary, dialog->fmt_l); gtk_label_set_text (GTK_LABEL (dialog->label_psample), sample_text); g_free (sample_text); v.f = -v.f; - sample_text = value_to_text (v, NULL, dialog->fmt_l); + sample_text = value_to_text (v, dialog->vs->dictionary, dialog->fmt_l); gtk_label_set_text (GTK_LABEL (dialog->label_nsample), sample_text); g_free (sample_text); } @@ -315,21 +315,20 @@ set_format_type_from_treeview (GtkTreeView *treeview, gpointer data) dialog->fmt_l = custom_format; dialog->fmt_l.type = *(int*) g_value_get_pointer (&the_value); - } - - /* Create the structure */ struct var_type_dialog * -var_type_dialog_create (GtkWindow *toplevel) +var_type_dialog_create (GtkWindow *toplevel, PsppireVarStore *vs) { gint i; struct var_type_dialog *dialog = g_malloc (sizeof (struct var_type_dialog)); GtkBuilder *xml = builder_new ("var-sheet-dialogs.ui"); + dialog->vs = vs; + dialog->window = get_widget_assert (xml,"var_type_dialog"); dialog->active_button = -1; @@ -790,14 +789,12 @@ on_var_type_ok_clicked (GtkWidget *w, gpointer data) gint decimals = atoi (gtk_entry_get_text (GTK_ENTRY (dialog->entry_decimals))); - gint new_type = VAL_NUMERIC; gint new_width = 0; bool result = false; struct fmt_spec spec; switch (dialog->active_button) { case BUTTON_STRING: - new_type = VAL_STRING; new_width = width; result = make_output_format_try (&spec, FMT_A, width, 0); break;