Binomial test dialog: Convert to new style of action objects.
[pspp] / src / ui / gui / psppire-data-editor.c
index 30098a7e50d905f439d3d68e9847fe72379862bf..02ef97a9077b1907958a867c611e419751c942b9 100644 (file)
@@ -1,5 +1,5 @@
 /* PSPPIRE - a graphical user interface for PSPP.
-   Copyright (C) 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+   Copyright (C) 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
 
    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
@@ -89,7 +89,6 @@ psppire_data_editor_dispose (GObject *obj)
   if (de->dispose_has_run)
     return;
 
-  g_object_unref (de->data_window);
   g_object_unref (de->data_store);
   g_object_unref (de->var_store);
 
@@ -230,8 +229,8 @@ new_data_callback (PsppireDataStore *ds, gpointer data)
      the data sheets.  If we don't do this, then the sheet remembers the value
      that was in the selected cell and stores it back, wiping out whatever
      value there is in the new data.  Bug #30502. */
-  for (i = 0; i < 4; i++)
-    psppire_sheet_unselect_range (PSPPIRE_SHEET (de->data_sheet[i]));
+  if (de->data_sheet[0] != NULL)
+    psppire_sheet_unselect_range (PSPPIRE_SHEET (de->data_sheet[0]));
 }
 
 static void
@@ -337,17 +336,18 @@ insert_variable_callback (PsppireDict *dict, gint x, gpointer data)
 
 
 static void
-delete_variable_callback (PsppireDict *dict, gint posn,
-                         gint x UNUSED, gint y UNUSED, gpointer data)
+delete_variable_callback (PsppireDict *dict,
+                          const struct variable *var UNUSED,
+                          gint dict_idx, gint case_idx UNUSED, gpointer data)
 {
   PsppireDataEditor *de = PSPPIRE_DATA_EDITOR (data);
 
   PsppireAxis *var_vaxis;
   g_object_get (de->var_sheet, "vertical-axis", &var_vaxis, NULL);
 
-  psppire_axis_delete (var_vaxis, posn, 1);
+  psppire_axis_delete (var_vaxis, dict_idx, 1);
 
-  psppire_axis_delete (de->haxis, posn, 1);
+  psppire_axis_delete (de->haxis, dict_idx, 1);
 }
 
 
@@ -384,8 +384,9 @@ psppire_data_editor_set_property (GObject         *object,
       psppire_data_editor_split_window (de, g_value_get_boolean (value));
       break;
     case PROP_DATA_WINDOW:
+      /* We hold no reference to this object, since it is used only by do_sort,
+       and that cannot be called unless the window is realized. */
       de->data_window = g_value_get_pointer (value);
-      g_object_ref (de->data_window);
       break;
     case PROP_DATA_STORE:
       if ( de->data_store) g_object_unref (de->data_store);
@@ -1435,7 +1436,6 @@ void
 psppire_data_editor_set_font (PsppireDataEditor *de, PangoFontDescription *font_desc)
 {
   set_font (GTK_WIDGET (de), font_desc);
-  gtk_container_foreach (GTK_CONTAINER (de), set_font, font_desc);
 }