[gnumeric] xls save: fix problem with sheets that are too big for the format.



commit 88c62dfa052b6f343e4198b4a66cf224670dafd4
Author: Morten Welinder <terra gnome org>
Date:   Sun Apr 26 12:32:31 2009 -0400

    xls save: fix problem with sheets that are too big for the format.
---
 NEWS                           |    3 +++
 plugins/excel/ChangeLog        |    5 +++++
 plugins/excel/ms-excel-write.c |    4 ++--
 3 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/NEWS b/NEWS
index cfb8114..7a10299 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,8 @@
 Gnumeric 1.9.7
 
+Morten:
+	* Fix xls save problem with sheets that are too big for the format.
+
 --------------------------------------------------------------------------
 Gnumeric 1.9.6
 
diff --git a/plugins/excel/ChangeLog b/plugins/excel/ChangeLog
index d154626..533827f 100644
--- a/plugins/excel/ChangeLog
+++ b/plugins/excel/ChangeLog
@@ -1,3 +1,8 @@
+2009-04-26  Morten Welinder  <terra gnome org>
+
+	* ms-excel-write.c (excel_sheet_extent): Fix off-by-one when we
+	overflow the area available.
+
 2009-04-25  Morten Welinder <terra gnome org>
 
 	* Release 1.9.6
diff --git a/plugins/excel/ms-excel-write.c b/plugins/excel/ms-excel-write.c
index 92b7bf5..6889bde 100644
--- a/plugins/excel/ms-excel-write.c
+++ b/plugins/excel/ms-excel-write.c
@@ -228,7 +228,7 @@ excel_sheet_extent (Sheet const *sheet, GnmRange *extent, GnmStyle **col_styles,
 				 "and this workbook has %d",
 				 maxcols),
 			  maxcols, extent->end.col);
-		extent->end.col = maxcols;
+		extent->end.col = maxcols - 1;
 	}
 	if (extent->end.row >= maxrows) {
 		gnm_io_warning (io_context,
@@ -240,7 +240,7 @@ excel_sheet_extent (Sheet const *sheet, GnmRange *extent, GnmStyle **col_styles,
 				 "and this workbook has %d",
 				 maxrows),
 			maxrows, extent->end.row);
-		extent->end.row = maxrows;
+		extent->end.row = maxrows - 1;
 	}
 
 	sheet_style_get_extent (sheet, extent, col_styles);



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