[gnumeric] use workbook_sheet_state_size



commit 57cbb28619c6fd96e9f84267dc666820984a2135
Author: Andreas J Guelzow <aguelzow pyrshep ca>
Date:   Thu May 26 12:59:10 2011 -0600

    use workbook_sheet_state_size
    
    2011-05-26  Andreas J. Guelzow <aguelzow pyrshep ca>
    
    	* src/workbook.c (workbook_sheet_state_size): adjust scale
    	(cmd_reorganize_sheets): use workbook_sheet_state_size

 ChangeLog      |    5 +++++
 src/commands.c |    3 ++-
 src/workbook.c |    2 +-
 3 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 86b816c..0eb7ad7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2011-05-26  Andreas J. Guelzow <aguelzow pyrshep ca>
 
+	* src/workbook.c (workbook_sheet_state_size): adjust scale
+	(cmd_reorganize_sheets): use workbook_sheet_state_size
+
+2011-05-26  Andreas J. Guelzow <aguelzow pyrshep ca>
+
 	* src/parse-util.h (gnm_conventions_dup): new
 	* src/parse-util.c (gnm_conventions_dup): new
 	* src/workbook-control.c (wb_control_parse_and_jump): accept both
diff --git a/src/commands.c b/src/commands.c
index c134c2f..deb28e1 100644
--- a/src/commands.c
+++ b/src/commands.c
@@ -4878,7 +4878,8 @@ cmd_reorganize_sheets (WorkbookControl *wbc,
 	me->redo_sheet = wb_control_cur_sheet (wbc);
 
 	me->cmd.sheet = NULL;
-	me->cmd.size = 1;
+	me->cmd.size = workbook_sheet_state_size (me->old) +
+		workbook_sheet_state_size (me->new);
 	me->cmd.cmd_descriptor =
 		workbook_sheet_state_diff (me->old, me->new);
 
diff --git a/src/workbook.c b/src/workbook.c
index 489912a..22f71bb 100644
--- a/src/workbook.c
+++ b/src/workbook.c
@@ -1326,7 +1326,7 @@ workbook_sheet_state_size (const WorkbookSheetState *wss)
 	int i;
 	for (i = 0; i < wss->n_sheets; i++) {
 		WorkbookSheetStateSheet *wsss = wss->sheets + i;
-		size += 50;  /* For ->sheet.  */
+		size += 5;  /* For ->sheet.  */
 		size += g_slist_length (wsss->properties);
 	}
 	return size;



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