[gnumeric] Conditional formats: fix criticals



commit 7d3188db97b9756165c93e75ddc7d400599fd9ed
Author: Morten Welinder <terra gnome org>
Date:   Sun Mar 16 17:09:41 2014 -0400

    Conditional formats: fix criticals
    
    This fixes criticals for conditional formats creating dynamic deps.

 ChangeLog         |    4 ++++
 NEWS              |    1 +
 src/expr.c        |    9 ++++++++-
 src/sheet-style.c |    2 +-
 4 files changed, 14 insertions(+), 2 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 66e93e0..a323cb6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2014-03-16  Morten Welinder  <terra gnome org>
 
+       * src/expr.c (gnm_expr_eval): Survive dynamic deps in conditional
+       formats.  I'm not positive we do things right, but this avoids
+       criticals, at least.
+
        * src/cell.c (cell_set_expr_internal): Don't change an existing
        value.
 
diff --git a/NEWS b/NEWS
index 77316d6..43f3188 100644
--- a/NEWS
+++ b/NEWS
@@ -28,6 +28,7 @@ Morten:
        * Fix font dialog problem with underline.
        * Fix crash reading strange xls file.  [Redhat #1076912]
        * Fix problem clearing existing values in some xlsx cells.  [#726297]
+       * Fix criticals for dynamic deps in conditional formats.  [#726163]
 
 --------------------------------------------------------------------------
 Gnumeric 1.12.12
diff --git a/src/expr.c b/src/expr.c
index f2283ec..5312a5f 100644
--- a/src/expr.c
+++ b/src/expr.c
@@ -1455,7 +1455,14 @@ gnm_expr_eval (GnmExpr const *expr, GnmEvalPos const *pos,
                        return (flags & GNM_EXPR_EVAL_PERMIT_EMPTY)
                            ? NULL : value_new_int (0);
                if (res->type == VALUE_CELLRANGE) {
-                       dependent_add_dynamic_dep (pos->dep, &res->v_range.cell);
+                       /*
+                        * pos->dep really shouldn't be NULL here, but it
+                        * will be if someone puts "indirect" into an
+                        * expression used for conditional formats.
+                        */
+                       if (pos->dep)
+                               dependent_add_dynamic_dep (pos->dep,
+                                                          &res->v_range.cell);
                        if (!(flags & GNM_EXPR_EVAL_PERMIT_NON_SCALAR)) {
                                res = value_intersection (res, pos);
                                return (res != NULL)
diff --git a/src/sheet-style.c b/src/sheet-style.c
index a61c06f..bcf0eec 100644
--- a/src/sheet-style.c
+++ b/src/sheet-style.c
@@ -1518,7 +1518,7 @@ sheet_style_get (Sheet const *sheet, int col, int row)
 
 #define border_null(b) ((b) == none || (b) == NULL)
 
-static inline void
+static void
 style_row (GnmStyle *style, int start_col, int end_col, GnmStyleRow *sr, gboolean accept_conditions)
 {
        GnmBorder const *top, *bottom, *none = gnm_style_border_none ();


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