gnumeric r16790 - in trunk: . plugins/fn-math



Author: mortenw
Date: Fri Sep 12 19:12:36 2008
New Revision: 16790
URL: http://svn.gnome.org/viewvc/gnumeric?rev=16790&view=rev

Log:
2008-09-12  Morten Welinder  <terra gnome org>

	* functions.c (gnumeric_sumif): Check that argv[2] is a range, if
	it is present.  Fixes #552006.



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

Modified: trunk/NEWS
==============================================================================
--- trunk/NEWS	(original)
+++ trunk/NEWS	Fri Sep 12 19:12:36 2008
@@ -22,9 +22,10 @@
 	  importing. [#549743]
 
 Morten:
-       * Fix display of array formulas.  [#550902]
-       * Fix off-by-one for random_landau.
-       * Fix error check for printing to file.
+	* Fix display of array formulas.  [#550902]
+	* Fix off-by-one for random_landau.
+	* Fix error check for printing to file.
+	* Fix SUMIF crash.  [#552006]
 
 --------------------------------------------------------------------------
 Gnumeric 1.9.2

Modified: trunk/plugins/fn-math/functions.c
==============================================================================
--- trunk/plugins/fn-math/functions.c	(original)
+++ trunk/plugins/fn-math/functions.c	Fri Sep 12 19:12:36 2008
@@ -696,7 +696,8 @@
 	if (r->type != VALUE_CELLRANGE ||
 	    ((sheet = eval_sheet (r->cell.a.sheet, ei->pos->sheet)) != r->cell.b.sheet &&
 	      r->cell.b.sheet != NULL) ||
-	    (!VALUE_IS_NUMBER (argv[1]) && !VALUE_IS_STRING (argv[1])))
+	    (!VALUE_IS_NUMBER (argv[1]) && !VALUE_IS_STRING (argv[1])) ||
+	    (argv[2] != NULL && argv[2]->type != VALUE_CELLRANGE))
 	        return value_new_error_VALUE (ei->pos);
 
 	res.date_conv = sheet ?	workbook_date_conv (sheet->workbook) : NULL;



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