[gnumeric] Conditional styles: fix crash on exit.



commit 409220bf4089163b20552acc2da85b0f108862f1
Author: Morten Welinder <terra gnome org>
Date:   Fri Jun 14 09:22:26 2013 -0400

    Conditional styles: fix crash on exit.

 ChangeLog      |    6 ++++++
 NEWS           |    2 +-
 src/workbook.c |   12 ++++++++++--
 3 files changed, 17 insertions(+), 3 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index e10a61c..2f2b827 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2013-06-14  Morten Welinder  <terra gnome org>
+
+       * src/workbook.c (workbook_sheet_delete): Debug.
+       (workbook_dispose): Also clear style here.  Styles can have
+       dependents now.  Fixes #702218.
+
 2013-06-14  Andreas J. Guelzow <aguelzow pyrshep ca>
 
        * src/sheet-view.c (sv_sheet_r1c1_changed): check for NULL selection
diff --git a/NEWS b/NEWS
index cebf399..5c07f65 100644
--- a/NEWS
+++ b/NEWS
@@ -58,7 +58,7 @@ Morten:
        * Introspection fixes.
        * Fix xls/biff5 link export.  [#701604]
        * Workaround problems with automake 1.13.
-       * Fix crashes on bogus xls file.  [#702101] [#702182]
+       * Fix crashes on bogus xls file.  [#702101] [#702182]  [#702218]
 
 --------------------------------------------------------------------------
 Gnumeric 1.12.2
diff --git a/src/workbook.c b/src/workbook.c
index 99b30d8..b0b2711 100644
--- a/src/workbook.c
+++ b/src/workbook.c
@@ -144,8 +144,11 @@ workbook_dispose (GObject *wb_object)
        /* Remove all contents while all sheets still exist */
        for (ptr = sheets; ptr != NULL ; ptr = ptr->next) {
                Sheet *sheet = ptr->data;
+               GnmRange r;
 
                sheet_destroy_contents (sheet);
+               range_init_full_sheet (&r, sheet);
+               sheet_style_set_range (sheet, &r, sheet_style_default (sheet));
        }
 
        /* Now remove the sheets themselves */
@@ -1069,11 +1072,16 @@ workbook_sheet_delete (Sheet *sheet)
         g_return_if_fail (IS_SHEET (sheet));
         g_return_if_fail (IS_WORKBOOK (sheet->workbook));
 
-       gnm_app_clipboard_invalidate_sheet (sheet);
-
        wb = sheet->workbook;
        sheet_index = sheet->index_in_wb;
 
+       if (gnm_debug_flag ("sheets"))
+               g_printerr ("Removing sheet %s from %s\n",
+                           sheet->name_unquoted,
+                           go_doc_get_uri (GO_DOC (wb)));
+
+       gnm_app_clipboard_invalidate_sheet (sheet);
+
        if (!wb->during_destruction) {
                workbook_focus_other_sheet (wb, sheet);
                /* During destruction this was already done.  */


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