[gnumeric] fix INTERPOLATION for missing targets #654941



commit 42de5574c791155afbab516661592f278ffd0bc2
Author: Andreas J Guelzow <aguelzow pyrshep ca>
Date:   Wed Jul 20 00:30:59 2011 -0600

    fix INTERPOLATION for missing targets #654941
    
    2011-07-20 Andreas J. Guelzow <aguelzow pyrshep ca>
    
    	* functions.c (gnumeric_interpolation): ignore missing targets

 plugins/fn-tsa/ChangeLog   |    4 ++++
 plugins/fn-tsa/functions.c |    6 +++++-
 2 files changed, 9 insertions(+), 1 deletions(-)
---
diff --git a/plugins/fn-tsa/ChangeLog b/plugins/fn-tsa/ChangeLog
index 7d602e4..fdadc0b 100644
--- a/plugins/fn-tsa/ChangeLog
+++ b/plugins/fn-tsa/ChangeLog
@@ -1,3 +1,7 @@
+2011-07-20 Andreas J. Guelzow <aguelzow pyrshep ca>
+
+	* functions.c (gnumeric_interpolation): ignore missing targets
+
 2011-07-19 Andreas J. Guelzow <aguelzow pyrshep ca>
 
 	* functions.c (gnumeric_interpolation): use collect_float_pairs
diff --git a/plugins/fn-tsa/functions.c b/plugins/fn-tsa/functions.c
index 6bed2d5..5ff754b 100644
--- a/plugins/fn-tsa/functions.c
+++ b/plugins/fn-tsa/functions.c
@@ -477,12 +477,16 @@ gnumeric_interpolation (GnmFuncEvalInfo *ei, GnmValue const * const *argv)
 	if (!gnm_range_increasing (vals0, n0))
 		res = value_new_error_std (ei->pos, GNM_ERROR_VALUE);
 	else {
+		int n = n2;
+
+		if (missing2)
+			gnm_strip_missing (vals2, &n, missing2);
 		res = value_new_array_non_init (1 , n2);
 		i = 0;
 
 		res->v_array.vals[0] = g_new (GnmValue *, n2);
 
-		fres = interpproc (vals0, vals1, n0, vals2, n2);
+		fres = interpproc (vals0, vals1, n0, vals2, n);
 		missing = missing2;
 		if (fres) {
 			i = 0;



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