[gnumeric] solver: keep target cell absolute.



commit e8289329d8981a49196ef2ae04bc56e04003eff7
Author: Morten Welinder <terra gnome org>
Date:   Sun Nov 1 10:37:01 2009 -0500

    solver: keep target cell absolute.

 src/tools/solver/solver.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)
---
diff --git a/src/tools/solver/solver.c b/src/tools/solver/solver.c
index 41e8181..ce21d9a 100644
--- a/src/tools/solver/solver.c
+++ b/src/tools/solver/solver.c
@@ -118,7 +118,15 @@ gnm_solver_param_set_input (SolverParameters *sp, GnmValue *v)
 void
 gnm_solver_param_set_target (SolverParameters *sp, GnmCellRef const *cr)
 {
-	GnmExprTop const *texpr = gnm_expr_top_new (gnm_expr_new_cellref (cr));
+	GnmCellRef cr2 = *cr;
+	GnmExprTop const *texpr;
+
+	/* Make reference absolute to avoid tracking problems on row/col
+	   insert.  */
+	cr2.row_relative = FALSE;
+	cr2.col_relative = FALSE;
+
+	texpr = gnm_expr_top_new (gnm_expr_new_cellref (&cr2));
 	dependent_managed_set_expr (&sp->target, texpr);
 	gnm_expr_top_unref (texpr);
 }



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