gnumeric r16324 - in trunk: . plugins/excel src



Author: mortenw
Date: Fri Feb  1 02:43:32 2008
New Revision: 16324
URL: http://svn.gnome.org/viewvc/gnumeric?rev=16324&view=rev

Log:
2008-01-31  Morten Welinder  <terra gnome org>

	* src/expr.c (gnm_expr_eval): Handle the case of no value
	calculated for the array.  [#513559]

2008-01-31  Morten Welinder  <terra gnome org>

	* ms-excel-read.c (excel_set_xf): Ditto.  Fixes #513551.



Modified:
   trunk/ChangeLog
   trunk/NEWS
   trunk/plugins/excel/ChangeLog
   trunk/plugins/excel/ms-excel-read.c
   trunk/src/expr.c

Modified: trunk/NEWS
==============================================================================
--- trunk/NEWS	(original)
+++ trunk/NEWS	Fri Feb  1 02:43:32 2008
@@ -17,8 +17,9 @@
 	* Fix loading of solver constraints.
 	* Fix solver issue.  [#512500]
 	* Fix corrupted-xls-file problems.  [#512984] [#513005] [#513313]
-	  [#513317] [#513361] [#513364]
+	  [#513317] [#513361] [#513364] [#513551]
 	* Fix non-ascii export problem.  [#511135]
+	* Band-aid evaluation problem with broken xls.  [#513559]
 
 --------------------------------------------------------------------------
 Gnumeric 1.8.0

Modified: trunk/plugins/excel/ms-excel-read.c
==============================================================================
--- trunk/plugins/excel/ms-excel-read.c	(original)
+++ trunk/plugins/excel/ms-excel-read.c	Fri Feb  1 02:43:32 2008
@@ -1859,10 +1859,15 @@
 static BiffXFData const *
 excel_set_xf (ExcelReadSheet *esheet, BiffQuery *q)
 {
-	guint16 const col    = XL_GETCOL (q);
-	guint16 const row    = XL_GETROW (q);
-	BiffXFData const *xf = excel_get_xf (esheet, GSF_LE_GET_GUINT16 (q->data + 4));
-	GnmStyle *mstyle     = excel_get_style_from_xf (esheet, xf);
+	guint16 col, row;
+	BiffXFData const *xf;
+	GnmStyle *mstyle;
+
+	XL_CHECK_CONDITION_VAL (q->length >= 6, NULL);
+	col = XL_GETCOL (q);
+	row = XL_GETROW (q);
+	xf = excel_get_xf (esheet, GSF_LE_GET_GUINT16 (q->data + 4));
+	mstyle = excel_get_style_from_xf (esheet, xf);
 
 	d (3, fprintf (stderr,"%s!%s%d = xf(0x%hx) = style (%p) [LEN = %u]\n", esheet->sheet->name_unquoted,
 		 col_name (col), row + 1, GSF_LE_GET_GUINT16 (q->data + 4), mstyle, q->length););

Modified: trunk/src/expr.c
==============================================================================
--- trunk/src/expr.c	(original)
+++ trunk/src/expr.c	Fri Feb  1 02:43:32 2008
@@ -1404,6 +1404,8 @@
 
 		gnm_cell_eval (corner);
 		a = corner->base.texpr->expr->array_corner.value;
+		if (a == NULL)
+			return handle_empty (NULL, flags);
 
 		if ((a->type == VALUE_CELLRANGE || a->type == VALUE_ARRAY)) {
 			int const num_x = value_area_get_width (a, pos);



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