gnumeric r16317 - in branches/gnumeric-1-8: . plugins/excel



Author: mortenw
Date: Thu Jan 31 03:03:05 2008
New Revision: 16317
URL: http://svn.gnome.org/viewvc/gnumeric?rev=16317&view=rev

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

	* ms-excel-read.c (excel_read_EXTERNNAME): Fix the error case.
	Fixes 513005.
	(excel_read_LABEL): Properly check record length.  Fixes #513313.

 	* ms-excel-write.c (excel_write_string): Fix length written for
 	the unicode case (with length measured in characters).



Modified:
   branches/gnumeric-1-8/NEWS
   branches/gnumeric-1-8/plugins/excel/ChangeLog
   branches/gnumeric-1-8/plugins/excel/ms-excel-read.c
   branches/gnumeric-1-8/plugins/excel/ms-excel-write.c

Modified: branches/gnumeric-1-8/NEWS
==============================================================================
--- branches/gnumeric-1-8/NEWS	(original)
+++ branches/gnumeric-1-8/NEWS	Thu Jan 31 03:03:05 2008
@@ -3,7 +3,8 @@
 Morten:
 	* Fix loading of solver constraints.
 	* Fix solver issue.  [#512500]
-	* Fix corrupted-xls-file problems.  [#512984] [#513005]
+	* Fix corrupted-xls-file problems.  [#512984] [#513005] [513313]
+	* Fix non-ascii export problem.  [#511135]
 
 --------------------------------------------------------------------------
 Gnumeric 1.8.1

Modified: branches/gnumeric-1-8/plugins/excel/ms-excel-read.c
==============================================================================
--- branches/gnumeric-1-8/plugins/excel/ms-excel-read.c	(original)
+++ branches/gnumeric-1-8/plugins/excel/ms-excel-read.c	Thu Jan 31 03:03:05 2008
@@ -5563,18 +5563,21 @@
 excel_read_LABEL (BiffQuery *q, ExcelReadSheet *esheet, gboolean has_markup)
 {
 	GnmValue *v;
-	guint16 const col = XL_GETCOL (q);
-	guint16 const row = XL_GETROW (q);
+	guint16 col, row;
 	guint in_len, str_len;
 	gchar *txt;
 
+	XL_CHECK_CONDITION (q->length >= 8);
 	in_len = q->opcode == BIFF_LABEL_v0 ?
 		GSF_LE_GET_GUINT8 (q->data + 7) : GSF_LE_GET_GUINT16 (q->data + 6);
-	g_return_if_fail (q->length - 8 >= in_len);
+	XL_CHECK_CONDITION (q->length - 8 >= in_len);
 
 	txt = excel_get_text (esheet->container.importer, q->data + 8,
 		in_len, &str_len);
 
+	col = XL_GETCOL (q);
+	row = XL_GETROW (q);
+
 	d (0, fprintf (stderr,"%s in %s%d;\n",
 		       has_markup ? "formatted string" : "string",
 		       col_name (col), row + 1););

Modified: branches/gnumeric-1-8/plugins/excel/ms-excel-write.c
==============================================================================
--- branches/gnumeric-1-8/plugins/excel/ms-excel-write.c	(original)
+++ branches/gnumeric-1-8/plugins/excel/ms-excel-write.c	Thu Jan 31 03:03:05 2008
@@ -322,7 +322,6 @@
 				output_len = g_utf8_pointer_to_offset (txt, in_bytes);
 			else
 				output_len = char_len;
-			output_len++;
 		}
 
 		switch (flags & STR_LENGTH_MASK) {



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