[gnumeric] GUI: More fixes for sheet removed underneath the dialog.



commit 6d04935c57d5ab6a113df3e0328f2cce814d2bf8
Author: Morten Welinder <terra gnome org>
Date:   Sun Mar 3 19:54:45 2013 -0500

    GUI: More fixes for sheet removed underneath the dialog.

 NEWS                                 |    2 +-
 src/dialogs/ChangeLog                |    5 +++++
 src/dialogs/dialog-data-table.c      |    3 +++
 src/dialogs/dialog-formula-guru.c    |    4 ++++
 src/dialogs/dialog-function-select.c |    4 ++++
 src/dialogs/dialog-insert-cells.c    |    4 ++++
 src/dialogs/dialog-so-list.c         |    4 ++++
 src/dialogs/dialog-so-styled.c       |   12 ++++++++----
 8 files changed, 33 insertions(+), 5 deletions(-)
---
diff --git a/NEWS b/NEWS
index c226b6c..e77d80c 100644
--- a/NEWS
+++ b/NEWS
@@ -41,7 +41,7 @@ Morten:
        * Unconditionally enable solver.
        * Rewrite the file history dialog.  [#694777]
        * Fix R.QF and R.QBINOM documentation.
-       * Fix sheet-removed crash for goal-seek and define-name.  [#364291]
+       * Fix sheet-removed crashes for a few dialogs.  [#364291]
 
 --------------------------------------------------------------------------
 Gnumeric 1.12.0
diff --git a/src/dialogs/ChangeLog b/src/dialogs/ChangeLog
index 12a8568..6951ec9 100644
--- a/src/dialogs/ChangeLog
+++ b/src/dialogs/ChangeLog
@@ -3,6 +3,11 @@
        * dialog-goal-seek.c (dialog_init): Setup destroy handler for
        sheet removal.  [#364291]
        * dialog-define-names.c (name_guru_init): Ditto.
+       * dialog-so-list.c (so_list_init): Ditto.
+       * dialog-so-styled.c (dialog_so_styled): Ditto.
+       * dialog-insert-cells.c (dialog_insert_cells): Ditto.
+       * dialog-data-table.c (data_table_init): Ditto.
+       * dialog-formula-guru.c (dialog_formula_guru): Ditto.
 
 2013-03-02  Jean Brefort  <jean brefort normalesup org>
 
diff --git a/src/dialogs/dialog-data-table.c b/src/dialogs/dialog-data-table.c
index a0e16b2..64743f7 100644
--- a/src/dialogs/dialog-data-table.c
+++ b/src/dialogs/dialog-data-table.c
@@ -97,6 +97,9 @@ data_table_init (GnmDialogDataTable *state, WBCGtk *wbcg)
                 return TRUE;
 
        state->dialog = go_gtk_builder_get_widget (state->gui, "DataTable");
+       gnm_dialog_setup_destroy_handlers (GTK_DIALOG (state->dialog),
+                                          state->wbcg,
+                                          GNM_DIALOG_DESTROY_CURRENT_SHEET_REMOVED);
 
        state->row_entry = init_entry (state, 0);
        state->col_entry = init_entry (state, 1);
diff --git a/src/dialogs/dialog-formula-guru.c b/src/dialogs/dialog-formula-guru.c
index c43d2b9..8fe1882 100644
--- a/src/dialogs/dialog-formula-guru.c
+++ b/src/dialogs/dialog-formula-guru.c
@@ -1087,6 +1087,10 @@ dialog_formula_guru (WBCGtk *wbcg, GnmFunc *fd)
        }
 
        state->dialog = go_gtk_builder_get_widget (state->gui, "formula_guru");
+       gnm_dialog_setup_destroy_handlers (GTK_DIALOG (state->dialog),
+                                          state->wbcg,
+                                          GNM_DIALOG_DESTROY_SHEET_REMOVED);
+
 
        if (dialog_formula_guru_init (state)) {
                go_gtk_notice_dialog (wbcg_toplevel (wbcg), GTK_MESSAGE_ERROR,
diff --git a/src/dialogs/dialog-function-select.c b/src/dialogs/dialog-function-select.c
index 296e004..7122987 100644
--- a/src/dialogs/dialog-function-select.c
+++ b/src/dialogs/dialog-function-select.c
@@ -1390,6 +1390,10 @@ dialog_function_select_full (WBCGtk *wbcg, char const *guru_key,
        state->paste.from = from;
        state->paste.to = to;
 
+       gnm_dialog_setup_destroy_handlers (GTK_DIALOG (state->dialog),
+                                          state->wbcg,
+                                          GNM_DIALOG_DESTROY_SHEET_REMOVED);
+
        if (mode == PASTE_MODE && state->paste.from >= 0) {
                GtkEditable *entry
                        = GTK_EDITABLE (wbcg_get_entry (state->wbcg));
diff --git a/src/dialogs/dialog-insert-cells.c b/src/dialogs/dialog-insert-cells.c
index 1789842..9f57546 100644
--- a/src/dialogs/dialog-insert-cells.c
+++ b/src/dialogs/dialog-insert-cells.c
@@ -156,6 +156,10 @@ dialog_insert_cells (WBCGtk *wbcg)
                return ;
        }
 
+       gnm_dialog_setup_destroy_handlers (GTK_DIALOG (state->dialog),
+                                          state->wbcg,
+                                          GNM_DIALOG_DESTROY_CURRENT_SHEET_REMOVED);
+
        state->ok_button = go_gtk_builder_get_widget (state->gui, "okbutton");
        g_signal_connect (G_OBJECT (state->ok_button),
                "clicked",
diff --git a/src/dialogs/dialog-so-list.c b/src/dialogs/dialog-so-list.c
index 4a58b30..26f57c1 100644
--- a/src/dialogs/dialog-so-list.c
+++ b/src/dialogs/dialog-so-list.c
@@ -111,6 +111,10 @@ so_list_init (GnmDialogSOList *state, WBCGtk *wbcg, SheetObject *so)
        state->so     = so;
        state->dialog = go_gtk_builder_get_widget (gui, "SOList");
 
+       gnm_dialog_setup_destroy_handlers (GTK_DIALOG (state->dialog),
+                                          state->wbcg,
+                                          GNM_DIALOG_DESTROY_CURRENT_SHEET_REMOVED);
+
        texpr = sheet_widget_list_base_get_content_link (so);
        state->content_entry = init_entry (state, gui, 1, 4, texpr);
        if (texpr) gnm_expr_top_unref (texpr);
diff --git a/src/dialogs/dialog-so-styled.c b/src/dialogs/dialog-so-styled.c
index 806439c..71ceca3 100644
--- a/src/dialogs/dialog-so-styled.c
+++ b/src/dialogs/dialog-so-styled.c
@@ -37,10 +37,10 @@
 #include <widgets/gnumeric-text-view.h>
 
 typedef struct {
-       GObject                 *so;
-       WBCGtk  *wbcg;
-       GOStyle         *orig_style;
-       char    *orig_text;
+       GObject *so;
+       WBCGtk *wbcg;
+       GOStyle *orig_style;
+       char *orig_text;
        PangoAttrList *orig_attributes;
 } DialogSOStyled;
 
@@ -145,6 +145,10 @@ dialog_so_styled (WBCGtk *wbcg,
                GTK_DIALOG_DESTROY_WITH_PARENT,
                NULL, NULL);
 
+       gnm_dialog_setup_destroy_handlers (GTK_DIALOG (dialog),
+                                          state->wbcg,
+                                          GNM_DIALOG_DESTROY_CURRENT_SHEET_REMOVED);
+
        help = gtk_dialog_add_button (GTK_DIALOG (dialog),
                GTK_STOCK_HELP,         GTK_RESPONSE_HELP);
        gnumeric_init_help_button (help, "sect-graphics-drawings");


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