Independent Samples dialog: Avoid direct access to sealed widget members
authorJohn Darrington <john@darrington.wattle.id.au>
Sun, 26 May 2013 11:37:56 +0000 (13:37 +0200)
committerJohn Darrington <john@darrington.wattle.id.au>
Tue, 28 May 2013 14:03:48 +0000 (16:03 +0200)
src/ui/gui/psppire-dialog-action-indep-samps.c

index 72e57731b93703ca90108566539e1bdbcb1e4e0d..df3805114938cbe4bebd6f169ce88d13bfedb717 100644 (file)
@@ -151,13 +151,14 @@ run_define_groups (PsppireDialogActionIndepSamps *act)
 {
   gint response;
   PsppireDialogAction *da = PSPPIRE_DIALOG_ACTION (act);
+  GtkWidget *parent1 = gtk_widget_get_parent (act->dg_table1);
+  GtkWidget *parent2 = gtk_widget_get_parent (act->dg_table2);
 
-  if ( act->dg_table2->parent)
-    gtk_container_remove (GTK_CONTAINER (act->dg_table2->parent), act->dg_table2);
-
-  if ( act->dg_table1->parent)
-    gtk_container_remove (GTK_CONTAINER (act->dg_table1->parent), act->dg_table1);
+  if (parent1)
+    gtk_container_remove (GTK_CONTAINER (parent1), act->dg_table1);
 
+  if (parent2)
+    gtk_container_remove (GTK_CONTAINER (parent2), act->dg_table2);
 
   if ( var_is_numeric (act->grp_var))
     {