gui: Drop 'dict' parameter from text_to_value().
authorBen Pfaff <blp@cs.stanford.edu>
Sat, 11 Jun 2011 04:55:47 +0000 (21:55 -0700)
committerBen Pfaff <blp@cs.stanford.edu>
Thu, 23 Jun 2011 15:50:23 +0000 (08:50 -0700)
This parameter is used only to obtain the dictionary's
encoding, which may also be obtained through the variable.

src/ui/gui/find-dialog.c
src/ui/gui/helper.c
src/ui/gui/helper.h
src/ui/gui/missing-val-dialog.c
src/ui/gui/val-labs-dialog.c

index 63604cf496e4a0ccb71329d18376f6571c6f1760..11a90594c3f5c507387a13764e1cd41280cbd2f1 100644 (file)
@@ -1,5 +1,5 @@
 /* PSPPIRE - a graphical user interface for PSPP.
 /* PSPPIRE - a graphical user interface for PSPP.
-   Copyright (C) 2007, 2009  Free Software Foundation
+   Copyright (C) 2007, 2009, 2011  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
 
    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
@@ -592,7 +592,7 @@ value_comparator_create (const struct variable *var, const PsppireDict *dict, co
   cmptr->destroy = cmptr_value_destroy;
   cmptr->dict = dict;
 
   cmptr->destroy = cmptr_value_destroy;
   cmptr->dict = dict;
 
-  text_to_value (target, dict, var, &vc->pattern);
+  text_to_value (target, var, &vc->pattern);
 
   return cmptr;
 }
 
   return cmptr;
 }
index 3f52a61f16a0d0eb12fa70425f60b44220001d17..71b1fb7284355317d081efece4f1d590156fc306 100644 (file)
@@ -65,14 +65,12 @@ value_to_text (union value v, const PsppireDict *dict, struct fmt_spec format)
 
    VAL will be initialised and filled by this function.
    It is the caller's responsibility to destroy VAL when no longer needed.
 
    VAL will be initialised and filled by this function.
    It is the caller's responsibility to destroy VAL when no longer needed.
-   VAR and DICT must be the variable and dictionary with which VAL
-   is associated.
+   VAR must be the variable with which VAL is associated.
 
    On success, VAL is returned, NULL otherwise.
 */
 union value *
 text_to_value (const gchar *text,
 
    On success, VAL is returned, NULL otherwise.
 */
 union value *
 text_to_value (const gchar *text,
-              const PsppireDict *dict,
               const struct variable *var,
               union value *val)
 {
               const struct variable *var,
               union value *val)
 {
@@ -98,7 +96,7 @@ text_to_value (const gchar *text,
 
   value_init (val, width);
   free (data_in (ss_cstr (text), UTF8, format->type, val, width,
 
   value_init (val, width);
   free (data_in (ss_cstr (text), UTF8, format->type, val, width,
-                 dict_get_encoding (dict->dict)));
+                 var_get_encoding (var)));
 
   return val;
 }
 
   return val;
 }
index e7fb62572d1c20baa11038a38979276aef6f04ad..78cd22cfbec2e164e72b358b74fbaa67b267a349 100644 (file)
@@ -55,7 +55,6 @@ gchar * value_to_text (union value v, const PsppireDict *dict, struct fmt_spec f
 
 union value *
 text_to_value (const gchar *text,
 
 union value *
 text_to_value (const gchar *text,
-              const PsppireDict *dict,
               const struct variable *var,
               union value *);
 
               const struct variable *var,
               union value *);
 
index 7e04b8548e02fb6cd02602645e2b8fbd99287b59..7222fd1a8acf7dce8a5a19d9063bfba9343d16e8 100644 (file)
@@ -1,5 +1,5 @@
 /* PSPPIRE - a graphical user interface for PSPP.
 /* PSPPIRE - a graphical user interface for PSPP.
-   Copyright (C) 2005, 2006, 2009  Free Software Foundation
+   Copyright (C) 2005, 2006, 2009, 2011  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
 
    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
@@ -98,7 +98,7 @@ missing_val_dialog_accept (GtkWidget *w, gpointer data)
              continue;
            }
 
              continue;
            }
 
-         if ( text_to_value (text, dialog->dict, dialog->pv, &v))
+         if ( text_to_value (text, dialog->pv, &v))
            {
              nvals++;
              mv_add_value (&dialog->mvl, &v);
            {
              nvals++;
              mv_add_value (&dialog->mvl, &v);
@@ -125,9 +125,9 @@ missing_val_dialog_accept (GtkWidget *w, gpointer data)
       const gchar *low_text = gtk_entry_get_text (GTK_ENTRY (dialog->low));
       const gchar *high_text = gtk_entry_get_text (GTK_ENTRY (dialog->high));
 
       const gchar *low_text = gtk_entry_get_text (GTK_ENTRY (dialog->low));
       const gchar *high_text = gtk_entry_get_text (GTK_ENTRY (dialog->high));
 
-      if ( text_to_value (low_text, dialog->dict, dialog->pv, &low_val)
+      if ( text_to_value (low_text, dialog->pv, &low_val)
           &&
           &&
-          text_to_value (high_text, dialog->dict, dialog->pv, &high_val))
+          text_to_value (high_text, dialog->pv, &high_val))
        {
          if ( low_val.f > high_val.f )
            {
        {
          if ( low_val.f > high_val.f )
            {
@@ -160,7 +160,6 @@ missing_val_dialog_accept (GtkWidget *w, gpointer data)
        {
          union value discrete_val;
          if ( !text_to_value (discrete_text, 
        {
          union value discrete_val;
          if ( !text_to_value (discrete_text, 
-                              dialog->dict,
                               dialog->pv,
                               &discrete_val))
            {
                               dialog->pv,
                               &discrete_val))
            {
index 950a59e6b4ef860ee44ce1240920bda3e4d32c85..610e5244dc7de2aebdbe4addff596bd180c87ff4 100644 (file)
@@ -77,7 +77,6 @@ on_label_entry_change (GtkEntry *entry, gpointer data)
   text = gtk_entry_get_text (GTK_ENTRY (dialog->value_entry));
 
   text_to_value (text,
   text = gtk_entry_get_text (GTK_ENTRY (dialog->value_entry));
 
   text_to_value (text,
-                dialog->dict,
                 dialog->pv,
                 &v);
 
                 dialog->pv,
                 &v);
 
@@ -150,7 +149,6 @@ on_value_entry_change (GtkEntry *entry, gpointer data)
 
   union value v;
   text_to_value (text,
 
   union value v;
   text_to_value (text,
-                dialog->dict,
                 dialog->pv,
                 &v);
 
                 dialog->pv,
                 &v);
 
@@ -282,7 +280,6 @@ on_change (GtkWidget *w, gpointer data)
   union value v;
 
   text_to_value (val_text,
   union value v;
 
   text_to_value (val_text,
-                dialog->dict,
                 dialog->pv,
                 &v);
 
                 dialog->pv,
                 &v);
 
@@ -308,7 +305,6 @@ on_add (GtkWidget *w, gpointer data)
   const gchar *text = gtk_entry_get_text (GTK_ENTRY (dialog->value_entry));
 
   text_to_value (text,
   const gchar *text = gtk_entry_get_text (GTK_ENTRY (dialog->value_entry));
 
   text_to_value (text,
-                dialog->dict,
                 dialog->pv,
                 &v);
 
                 dialog->pv,
                 &v);