[gnumeric] Sheet Resize: only warn for actual resizes.



commit e15ea4eef2ae6fbd7bdfd9023c3ab3a8b1cc4539
Author: Morten Welinder <terra gnome org>
Date:   Mon May 11 20:47:28 2009 -0400

    Sheet Resize: only warn for actual resizes.
---
 ChangeLog   |    3 +++
 src/sheet.c |   11 ++++++-----
 2 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 8594402..6a76b6b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2009-05-11  Morten Welinder  <terra gnome org>
 
+	* src/sheet.c (gnm_sheet_resize_main): Only warn for a resize that
+	is not a no-op.
+
 	* src/sheet-style.c (sheet_style_init_size): Don't set partial_col
 	and partial_row.
 	(cb_style_list_add_node): Deal without partial_col and
diff --git a/src/sheet.c b/src/sheet.c
index 7d8bd8d..c1c5899 100644
--- a/src/sheet.c
+++ b/src/sheet.c
@@ -1113,6 +1113,7 @@ gnm_sheet_resize_main (Sheet *sheet, int cols, int rows,
 		       GOCmdContext *cc, GOUndo **pundo)
 {
 	int old_cols, old_rows;
+	static gboolean warned = FALSE;
 
 	if (pundo) *pundo = NULL;
 
@@ -1121,6 +1122,11 @@ gnm_sheet_resize_main (Sheet *sheet, int cols, int rows,
 	if (old_cols == cols && old_rows == rows)
 		return;
 
+	if (!warned) {
+		g_warning ("Changing sheet size is experimental.");
+		warned = TRUE;
+	}
+
 	/* ---------------------------------------- */
 	/* Remove the columns and rows that will disappear.  */
 
@@ -1256,16 +1262,11 @@ gnm_sheet_resize_main (Sheet *sheet, int cols, int rows,
 GOUndo *
 gnm_sheet_resize (Sheet *sheet, int cols, int rows, GOCmdContext *cc)
 {
-	static gboolean warned = FALSE;
 	GOUndo *undo = NULL;
 
 	g_return_val_if_fail (IS_SHEET (sheet), NULL);
 	g_return_val_if_fail (gnm_sheet_valid_size (cols, rows), NULL);
 
-	if (!warned) {
-		g_warning ("Changing sheet size is experimental.");
-		warned = TRUE;
-	}
 	gnm_sheet_resize_main (sheet, cols, rows, cc, &undo);
 
 	return undo;



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