[gnumeric] Fix cell extent caclulation for xlsx export. [#661958]



commit 8a3a1ee49aeedbefc48f6ab82ae3135fc1d1f8e8
Author: Andreas J Guelzow <aguelzow pyrshep ca>
Date:   Mon Oct 17 14:02:31 2011 -0600

    Fix cell extent caclulation for xlsx export. [#661958]
    
    2011-10-17  Andreas J. Guelzow <aguelzow pyrshep ca>
    
    	* xlsx-write.c (xlsx_write_sheet): don't miss cell content that
    	yields empty cells

 NEWS                       |    1 +
 plugins/excel/ChangeLog    |    5 +++++
 plugins/excel/xlsx-write.c |   10 +++++-----
 3 files changed, 11 insertions(+), 5 deletions(-)
---
diff --git a/NEWS b/NEWS
index f99aa9b..a83bb25 100644
--- a/NEWS
+++ b/NEWS
@@ -28,6 +28,7 @@ Andreas:
 	with fixed arrays.
 	* Import ODS-like documents produced by Google-docs. [#660657]
 	* Fix border import from 1C generated xls files. [#660605]
+	* Fix cell extent caclulation for xlsx export. [#661958]
 
 Jean:
 	* Make things build against gtk+-3.0.
diff --git a/plugins/excel/ChangeLog b/plugins/excel/ChangeLog
index 0c990cd..e61cff5 100644
--- a/plugins/excel/ChangeLog
+++ b/plugins/excel/ChangeLog
@@ -1,3 +1,8 @@
+2011-10-17  Andreas J. Guelzow <aguelzow pyrshep ca>
+
+	* xlsx-write.c (xlsx_write_sheet): don't miss cell content that
+	yields empty cells
+
 2011-10-07  Andreas J. Guelzow <aguelzow pyrshep ca>
 
 	* ms-excel-read.c (excel_choose_border): new
diff --git a/plugins/excel/xlsx-write.c b/plugins/excel/xlsx-write.c
index f58b314..7c894be 100644
--- a/plugins/excel/xlsx-write.c
+++ b/plugins/excel/xlsx-write.c
@@ -1921,17 +1921,17 @@ xlsx_write_sheet (XLSXWriteState *state, GsfOutfile *dir, GsfOutfile *wb_part, u
 		GSF_OUTFILE_OPEN_PKG (wb_part),
 		"http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet";);
 	GsfXMLOut *xml;
-	GnmRange  extent;
+	GnmRange  extent, cell_extent;
 	GSList   *charts;
 	char const *chart_drawing_rel_id = NULL;
 	GnmStyle **col_styles;
 
 	state->sheet = workbook_sheet_by_index (state->base.wb, i);
-	col_styles = g_new (GnmStyle*, MIN (XLSX_MAX_COLS,
-					    gnm_sheet_get_max_cols (state->sheet)));
+	col_styles = g_new (GnmStyle*, XLSX_MAX_COLS);
 	excel_sheet_extent (state->sheet, &extent, col_styles,
-		MIN (XLSX_MAX_COLS, gnm_sheet_get_max_cols (state->sheet)),
-		MIN (XLSX_MAX_ROWS, gnm_sheet_get_max_rows (state->sheet)), state->io_context);
+			    XLSX_MAX_COLS, XLSX_MAX_ROWS, state->io_context);
+	cell_extent = sheet_get_cells_extent (state->sheet);
+	extent = range_union (&extent, &cell_extent);
 
 /*   comments   */
 	charts = sheet_objects_get (state->sheet, NULL, CELL_COMMENT_TYPE);



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