Commit 0643e252 authored by Morten Welinder's avatar Morten Welinder

Deps: fix crash related to dynamic deps.

I'm certain that the patch avoid the problem, but I am not certain
that the situation in which the crash occurred should be allowed to
happen: an unlinked dep with dynamic dependencies.
parent 8071894c
2011-03-21 Morten Welinder <terra@gnome.org>
* src/dependent.c (dependent_set_expr): Make sure we clear dynamic
deps, even if not linked. Fixes #645209.
(dependents_dump): New function extracted from...
* src/wbc-gtk.c (cb_workbook_debug_info): ...here.
2011-03-18 Morten Welinder <terra@gnome.org>
* src/parser.y: Apply ugly patch for xlsx global names. See bug
......
......@@ -39,6 +39,7 @@ Morten:
* Hopefully make print preview work on win32. [#533795]
* Improve quit dialog's non-ascii handling. [#644982]
* Make print-preview work on win32 by avoiding gtk+. [#533795]
* Fix crash related to dynamic deps. [#645209]
Stanley Pinchak:
* Improve "dif" output.
......
......@@ -41,6 +41,7 @@
#include <string.h>
static void dependent_changed (GnmDependent *dep);
static void dependent_clear_dynamic_deps (GnmDependent *dep);
/* ------------------------------------------------------------------------- */
......@@ -365,6 +366,8 @@ dependent_set_expr (GnmDependent *dep, GnmExprTop const *new_texpr)
if (dependent_is_linked (dep))
dependent_unlink (dep);
if (dep->flags & DEPENDENT_HAS_DYNAMIC_DEPS)
dependent_clear_dynamic_deps (dep);
if (t == DEPENDENT_CELL) {
/*
......@@ -1330,7 +1333,7 @@ dependent_add_dynamic_dep (GnmDependent *dep, GnmRangeRef const *rr)
workbook_link_3d_dep (dep);
}
static inline void
static void
dependent_clear_dynamic_deps (GnmDependent *dep)
{
g_hash_table_remove (dep->sheet->deps->dynamic_deps, dep);
......@@ -2971,6 +2974,17 @@ gnm_dep_container_dump (GnmDepContainer const *deps,
}
}
void
dependents_dump (Workbook *wb)
{
WORKBOOK_FOREACH_SHEET
(wb, sheet,
{
g_printerr ("Dependencies for %s:\n", sheet->name_unquoted);
gnm_dep_container_dump (sheet->deps, sheet);
});
}
void
gnm_dep_container_sanity_check (GnmDepContainer const *deps)
{
......
......@@ -110,6 +110,7 @@ void workbook_queue_all_recalc (Workbook *wb);
GnmDepContainer *gnm_dep_container_new (Sheet *sheet);
void gnm_dep_container_dump (GnmDepContainer const *deps,
Sheet *sheet);
void dependents_dump (Workbook *wb);
void gnm_dep_container_sanity_check (GnmDepContainer const *deps);
void gnm_dep_container_resize (GnmDepContainer *deps, int rows);
......
......@@ -2206,9 +2206,7 @@ cb_workbook_debug_info (WBCGtk *wbcg)
Workbook *wb = wb_control_get_workbook (WORKBOOK_CONTROL (wbcg));
if (gnm_debug_flag ("deps")) {
WORKBOOK_FOREACH_SHEET (wb, sheet,
g_printerr ("Dependencies for %s:\n", sheet->name_unquoted);
gnm_dep_container_dump (sheet->deps, sheet););
dependents_dump (wb);
}
if (gnm_debug_flag ("expr-sharer")) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment