[gnumeric] graph: fix old graph legend bug.



commit 5bda3bdf9f01b3e0f0e981e7d33c7a7ac09e15ed
Author: Morten Welinder <terra gnome org>
Date:   Wed May 5 14:35:16 2010 -0400

    graph: fix old graph legend bug.

 ChangeLog   |    5 +++++
 NEWS        |    1 +
 src/expr.c  |    7 ++++++-
 src/graph.c |   15 ++++++++++-----
 4 files changed, 22 insertions(+), 6 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 9b7e105..33cb4d2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2010-05-05  Morten Welinder  <terra gnome org>
+
+	* src/expr.c (value_intersection): Handle non-cell dependency
+	better.  Fixes #142412.
+
 2010-05-04 Andreas J. Guelzow <aguelzow pyrshep ca>
 
 	* src/colrow.h (_ColRowInfo): add in_advanced_filter field
diff --git a/NEWS b/NEWS
index e83543c..d2009a7 100644
--- a/NEWS
+++ b/NEWS
@@ -34,6 +34,7 @@ Morten:
 	* Improve IMPOWER.
 	* Fix sheet duplicate bugs.  [Part of #617469]
 	* Clean-up handling of pango contexts.
+	* Fix old graph problem.  [#1424112]
 
 --------------------------------------------------------------------------
 Gnumeric 1.10.2
diff --git a/src/expr.c b/src/expr.c
index 1e05800..70225c9 100644
--- a/src/expr.c
+++ b/src/expr.c
@@ -734,7 +734,12 @@ value_intersection (GnmValue *v, GnmEvalPos const *pos)
 		int col = pos->eval.col;
 		int row = pos->eval.row;
 
-		if (r.start.row == r.end.row) {
+		if (pos->dep && !dependent_is_cell (pos->dep)) {
+			/* See bug #142412.  */
+			col = r.start.col;
+			row = r.start.row;
+			found = TRUE;
+		} else if (r.start.row == r.end.row) {
 			if (r.start.col <= col && col <= r.end.col) {
 				row = r.start.row;
 				found = TRUE;
diff --git a/src/graph.c b/src/graph.c
index 144b604..0805c49 100644
--- a/src/graph.c
+++ b/src/graph.c
@@ -325,9 +325,12 @@ scalar_get_val (GnmGODataScalar *scalar)
 	if (scalar->val == NULL) {
 		if (scalar->dep.texpr != NULL) {
 			GnmEvalPos pos;
-			scalar->val = gnm_expr_top_eval (scalar->dep.texpr,
-				eval_pos_init_dep (&pos, &scalar->dep),
-				GNM_EXPR_EVAL_PERMIT_EMPTY);
+
+			eval_pos_init_dep (&pos, &scalar->dep);
+
+			scalar->val = gnm_expr_top_eval
+				(scalar->dep.texpr, &pos,
+				 GNM_EXPR_EVAL_PERMIT_EMPTY);
 		} else
 			scalar->val = value_new_empty ();
 	}
@@ -494,9 +497,10 @@ gnm_go_data_vector_load_len (GODataVector *dat)
 				}
 			}
 			g_slist_free (l);
-		} else
+		} else {
 			vec->val = gnm_expr_top_eval (vec->dep.texpr, &ep,
 				GNM_EXPR_EVAL_PERMIT_NON_SCALAR | GNM_EXPR_EVAL_PERMIT_EMPTY);
+		}
 	}
 
 	if (vec->val != NULL) {
@@ -881,9 +885,10 @@ gnm_go_data_matrix_load_size (GODataMatrix *dat)
 	int old_rows = dat->size.rows, old_columns = dat->size.columns;
 
 	eval_pos_init_dep (&ep, &mat->dep);
-	if (mat->val == NULL)
+	if (mat->val == NULL) {
 		mat->val = gnm_expr_top_eval (mat->dep.texpr, &ep,
 			GNM_EXPR_EVAL_PERMIT_NON_SCALAR | GNM_EXPR_EVAL_PERMIT_EMPTY);
+	}
 
 	if (mat->val != NULL) {
 		switch (mat->val->type) {



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