[gnumeric] Fix writing of xlsx files with full extent [#569862]



commit 41cf73bec669d8f20302f7d1eb0bdb6f044b4969
Author: Andreas J. Guelzow <aguelzow pyrshep ca>
Date:   Sun May 10 22:53:33 2009 -0600

    Fix writing of xlsx files with full extent [#569862]
    
    2009-05-10  Andreas J. Guelzow <aguelzow pyrshep ca>
    
    	* xlsx-write.c (xlsx_write_cols): fix off-by-one error [#569862]
---
 NEWS                       |    1 +
 plugins/excel/ChangeLog    |    4 ++++
 plugins/excel/xlsx-write.c |   11 +++++++----
 3 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/NEWS b/NEWS
index 5c92095..3c4a2a8 100644
--- a/NEWS
+++ b/NEWS
@@ -9,6 +9,7 @@ Andreas:
 	* Fix tag ordering in xlsx files [#581896]
 	* Allow MS generated ODF files to be opened
 	* Load large ODF files by increasing the sheet size.
+	* Fix writing of xlsx files with full extent [#569862]
 
 Jody:
 	* Closer to a turnkey win32 build.
diff --git a/plugins/excel/ChangeLog b/plugins/excel/ChangeLog
index 7e9c350..c58a441 100644
--- a/plugins/excel/ChangeLog
+++ b/plugins/excel/ChangeLog
@@ -1,5 +1,9 @@
 2009-05-10  Andreas J. Guelzow <aguelzow pyrshep ca>
 
+	* xlsx-write.c (xlsx_write_cols): fix off-by-one error [#569862]
+	
+2009-05-10  Andreas J. Guelzow <aguelzow pyrshep ca>
+
 	* xlsx-write.c (xlsx_write_sheet): write the tags in schema ordering
 
 2009-05-06  Morten Welinder <terra gnome org>
diff --git a/plugins/excel/xlsx-write.c b/plugins/excel/xlsx-write.c
index 347f2d4..bcbe353 100644
--- a/plugins/excel/xlsx-write.c
+++ b/plugins/excel/xlsx-write.c
@@ -701,15 +701,18 @@ xlsx_write_cols (XLSXWriteState *state, GsfXMLOut *xml, GnmRange const *extent)
 {
 	ColRowInfo const *ci, *info;
 	gboolean has_child = FALSE;
-	int first_col = 0, i;
+	int first_col = -1, i;
 
-	info = sheet_col_get (state->sheet, first_col);
-	while (info == NULL && first_col <= extent->end.col)
+	g_print ("xlsx_write_cols extent: %i %i\n", extent->start.col, extent->end.col);
+
+	do {
 		info = sheet_col_get (state->sheet, ++first_col);
+	} while (info == NULL && first_col < extent->end.col);
+
 	if (info == NULL)
 		return;
 
-	for (i = first_col + 1 ; i <= extent->end.col ; i++) {
+	for (i = first_col + 1; i <= extent->end.col ; i++) {
 		ci = sheet_col_get (state->sheet, i);
 		if (!colrow_equal (info, ci)) {
 			has_child |= xlsx_write_col (state, xml, info, first_col, i-1, has_child);



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