pspp-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Pspp-cvs] pspp/src/ui/gui data-editor.c


From: John Darrington
Subject: [Pspp-cvs] pspp/src/ui/gui data-editor.c
Date: Wed, 04 Jul 2007 05:22:51 +0000

CVSROOT:        /sources/pspp
Module name:    pspp
Changes by:     John Darrington <jmd>   07/07/04 05:22:51

Modified files:
        src/ui/gui     : data-editor.c 

Log message:
        Fixed bug updating cell ref and datum entry widgets

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/pspp/src/ui/gui/data-editor.c?cvsroot=pspp&r1=1.30&r2=1.31

Patches:
Index: data-editor.c
===================================================================
RCS file: /sources/pspp/pspp/src/ui/gui/data-editor.c,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -b -r1.30 -r1.31
--- data-editor.c       4 Jul 2007 03:21:29 -0000       1.30
+++ data-editor.c       4 Jul 2007 05:22:51 -0000       1.31
@@ -1287,7 +1287,8 @@
 {
   GladeXML *data_editor_xml = data;
 
-  PsppireDataStore *data_store = PSPPIRE_DATA_STORE (gtk_sheet_get_model 
(sheet));
+  PsppireDataStore *data_store =
+    PSPPIRE_DATA_STORE (gtk_sheet_get_model (sheet));
 
   g_return_val_if_fail (data_editor_xml, FALSE);
 
@@ -1296,14 +1297,18 @@
       const struct variable *var =
        psppire_dict_get_variable (data_store->dict, col);
 
-      {
        /* The entry where the reference to the current cell is displayed */
        GtkEntry *cell_ref_entry =
          GTK_ENTRY (get_widget_assert (data_editor_xml,
                                        "cell_ref_entry"));
+      GtkEntry *datum_entry =
+       GTK_ENTRY (get_widget_assert (data_editor_xml,
+                                     "datum_entry"));
 
+      if ( var )
+       {
        gchar *text = g_strdup_printf ("%d: %s", row,
-                                      var ? var_get_name (var) : "");
+                                        var_get_name (var));
 
        gchar *s = pspp_locale_to_utf8 (text, -1, 0);
 
@@ -1313,12 +1318,12 @@
 
        g_free (s);
       }
+      else
+       gtk_entry_set_text (cell_ref_entry, "");
 
-      {
-       GtkEntry *datum_entry =
-         GTK_ENTRY (get_widget_assert (data_editor_xml,
-                                       "datum_entry"));
 
+      if ( var )
+       {
        gchar *text =
          psppire_data_store_get_string (data_store, row,
                                         var_get_dict_index(var));
@@ -1328,6 +1333,8 @@
 
        free (text);
       }
+      else
+       gtk_entry_set_text (datum_entry, "");
     }
 
   return FALSE;




reply via email to

[Prev in Thread] Current Thread [Next in Thread]