[gnumeric] sheet style: fix off-by-ones errors in resize.



commit eb58555e7b8d74430ef13a24d562726aebca7ce5
Author: Morten Welinder <terra gnome org>
Date:   Mon Dec 31 16:17:02 2012 -0500

    sheet style: fix off-by-ones errors in resize.

 ChangeLog         |    3 +++
 NEWS              |    1 +
 src/sheet-style.c |    2 +-
 3 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index a3911b5..979e644 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2012-12-31  Morten Welinder  <terra gnome org>
 
+	* src/sheet-style.c (sheet_style_resize): Double off-by-one.
+	Fixed #690929.
+
 	* src/ssdiff.c: Introduce --highlight mode.
 
 2012-12-30  Morten Welinder  <terra gnome org>
diff --git a/NEWS b/NEWS
index 7902b75..ccc905b 100644
--- a/NEWS
+++ b/NEWS
@@ -13,6 +13,7 @@ Morten:
 	* Always compile ssconvert, ssindex, and ssgrep.
 	* New utility: ssdiff.
 	* Remove disabled corba plugin.
+	* Fix off-by-ones in sheet resize.  [#690929]
   
 --------------------------------------------------------------------------
 Gnumeric 1.12.0
diff --git a/src/sheet-style.c b/src/sheet-style.c
index dccd295..5d86656 100644
--- a/src/sheet-style.c
+++ b/src/sheet-style.c
@@ -691,7 +691,7 @@ sheet_style_resize (Sheet *sheet, int cols, int rows)
 
 	/* Save the style for the surviving area.  */
 	range_init (&save_range, 0, 0,
-		    MIN (cols, old_cols), MIN (rows, old_rows));
+		    MIN (cols, old_cols) - 1, MIN (rows, old_rows) - 1);
 	styles = sheet_style_get_range (sheet, &save_range);
 
 	/* Build new empty structures.  */



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