[gnumeric] xls: fix export of textboxes.



commit 8eae9adb87efb0fa150ed46ad3e6e01a88d7419f
Author: Morten Welinder <terra gnome org>
Date:   Thu Apr 15 18:32:59 2010 -0400

    xls: fix export of textboxes.

 NEWS                           |    2 +-
 plugins/excel/ChangeLog        |   11 ++++++++---
 plugins/excel/ms-excel-write.c |   12 +++++++-----
 3 files changed, 16 insertions(+), 9 deletions(-)
---
diff --git a/NEWS b/NEWS
index b4b3733..1516105 100644
--- a/NEWS
+++ b/NEWS
@@ -1,7 +1,6 @@
 Gnumeric 1.10.2
 
 Alexander Kahl & Sven Mantei:
-
 	* Some documentation updates
 
 Andreas:
@@ -31,6 +30,7 @@ Morten:
 	* Fix export xls of XIRR, FVSCHEDULE, and XNPV.  [#614257]
 	* Set win32 stack size to 64M.  [#571346]
 	* Patch gtk+ so GtkEntry widgets on win32 draw right.  [#603667]
+	* Fix xls export of cell comments.  [#615845]
 
 --------------------------------------------------------------------------
 Gnumeric 1.10.1
diff --git a/plugins/excel/ChangeLog b/plugins/excel/ChangeLog
index 693fa67..f27341f 100644
--- a/plugins/excel/ChangeLog
+++ b/plugins/excel/ChangeLog
@@ -1,8 +1,13 @@
+2010-04-15  Morten Welinder  <terra gnome org>
+
+	* ms-excel-write.c (excel_write_textbox_or_widget_v8): Take
+	bp->length into account too.
+
 2010-04-14  Andreas J. Guelzow <aguelzow pyrshep ca>
 
-	* xlsx-write.c (xlsx_write_workbook): write 1900/1904 date 
-	  base info
-	
+	* xlsx-write.c (xlsx_write_workbook): write 1900/1904 date base
+	info
+
 2010-04-14  Andreas J. Guelzow <aguelzow pyrshep ca>
 
 	* xlsx-read.c (xlsx_CT_WorkbookPr): new
diff --git a/plugins/excel/ms-excel-write.c b/plugins/excel/ms-excel-write.c
index 5497c69..58c1117 100644
--- a/plugins/excel/ms-excel-write.c
+++ b/plugins/excel/ms-excel-write.c
@@ -4429,7 +4429,7 @@ excel_write_textbox_or_widget_v8 (ExcelWriteSheet *esheet,
 
 	ms_escher_spcontainer_end (escher, spmark);
 
-	sppos = bp->streamPos + 4;
+	sppos = bp->streamPos + bp->length + 4;
 	splen = GSF_LE_GET_GUINT32 (escher->str + spmark + 4);
 
 	draw_len += escher->len;
@@ -4531,10 +4531,12 @@ excel_write_textbox_or_widget_v8 (ExcelWriteSheet *esheet,
 	/* ---------------------------------------- */
 
 	if (do_textbox) {
+		guint8 spbuf[4];
 		gsize this_len = excel_write_ClientTextbox (ewb, so, label);
 		draw_len += this_len;
 		splen += this_len;
-		ms_biff_put_abs_write (bp, sppos + 4, &splen, 4);
+		GSF_LE_SET_GUINT32 (spbuf, splen);
+		ms_biff_put_abs_write (bp, sppos + 4, spbuf, 4);
 	}
 
 	g_free (name);
@@ -5316,13 +5318,13 @@ excel_write_objs_v8 (ExcelWriteSheet *esheet)
 
 	if (bp->version >= MS_BIFF_V8) {
 		char tmp[4];
-		guint32 spcontlen = len + 48;
-		guint32 dgcontlen = spcontlen + 24;
+		guint32 spgrcontlen = len + 48;
+		guint32 dgcontlen = spgrcontlen + 24;
 
 		GSF_LE_SET_GUINT32 (tmp, dgcontlen);
 		ms_biff_put_abs_write (bp, fpos + 4, tmp, 4);
 
-		GSF_LE_SET_GUINT32 (tmp, spcontlen);
+		GSF_LE_SET_GUINT32 (tmp, spgrcontlen);
 		ms_biff_put_abs_write (bp, fpos + 28, tmp, 4);
 	}
 }



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