gnumeric r16575 - in trunk: . plugins/fn-lookup



Author: jbrefort
Date: Sat May 17 05:35:44 2008
New Revision: 16575
URL: http://svn.gnome.org/viewvc/gnumeric?rev=16575&view=rev

Log:
2008-05-17  Jean Brefort  <jean brefort normalesup org>

	* functions.c: (gnumeric_index): correctly check first argument
	type. Fixes #533247.



Modified:
   trunk/NEWS
   trunk/plugins/fn-lookup/ChangeLog
   trunk/plugins/fn-lookup/functions.c

Modified: trunk/NEWS
==============================================================================
--- trunk/NEWS	(original)
+++ trunk/NEWS	Sat May 17 05:35:44 2008
@@ -1,6 +1,7 @@
 Gnumeric 1.9.1
 
 Jean:
+	* Fix INDEX related crash. [#533247]
 	* Fix LINEST and LOGREG crashes.  [#533263]
 
 Morten:

Modified: trunk/plugins/fn-lookup/functions.c
==============================================================================
--- trunk/plugins/fn-lookup/functions.c	(original)
+++ trunk/plugins/fn-lookup/functions.c	Sat May 17 05:35:44 2008
@@ -1072,7 +1072,7 @@
 	}
 
 #warning Work out a way to fall back to returning value when a reference is unneeded
-	if (VALUE_ARRAY	!= v->type) {
+	if (VALUE_CELLRANGE == v->type) {
 		GnmRangeRef const *src = &v->v_range.cell;
 		GnmCellRef a = src->a, b = src->b;
 		Sheet *start_sheet, *end_sheet;
@@ -1086,8 +1086,10 @@
 		a.col = r.start.col; if (a.col_relative) a.col -= ei->pos->eval.col;
 		b.col = r.start.col; if (b.col_relative) b.col -= ei->pos->eval.col;
 		res = value_new_cellrange_unsafe (&a, &b);
-	} else
+	} else if (VALUE_ARRAY == v->type)
 		res = value_dup (value_area_fetch_x_y (v, elem[1], elem[0], ei->pos));
+	else
+		res = value_new_error_REF (ei->pos);
 	value_release (v);
 	return res;
 }



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