[gnumeric] Style: improve style optimization performance.



commit 3a5364cbb6311a4841f3f9d1433987f187cf6bf1
Author: Morten Welinder <terra gnome org>
Date:   Fri Apr 29 19:53:41 2011 -0400

    Style: improve style optimization performance.

 ChangeLog         |    2 ++
 src/sheet-style.c |    8 ++++++--
 2 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index ea44e39..189ca17 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,8 @@
 	* src/sheet-style.c (cell_tile_apply): Prepare for, but do not
 	activate, optimization of newly-divided tiles.  When activated
 	should fix #648868.
+	(cell_tile_apply): Don't let the optimization go recursively down
+	the tree.
 
 2011-04-22  Jean Brefort  <jean brefort normalesup org>
 
diff --git a/src/sheet-style.c b/src/sheet-style.c
index dbe14d7..df7facd 100644
--- a/src/sheet-style.c
+++ b/src/sheet-style.c
@@ -53,6 +53,7 @@ static gboolean debug_style_optimize;
 
 typedef struct {
 	GnmSheetSize const *ss;
+	gboolean recursion;
 } CellTileOptimize;
 
 static void
@@ -969,6 +970,7 @@ try_optimize:
 	{
 		CellTileOptimize cto;
 		cto.ss = gnm_sheet_get_size (rs->sheet);
+		cto.recursion = FALSE;
 #if 0
 		cell_tile_optimize (tile, level, &cto, corner_col, corner_row);
 #endif
@@ -2706,8 +2708,9 @@ cell_tile_optimize (CellTile **tile, int level, CellTileOptimize *data,
 			for (c = 0 ; c < TILE_SIZE_COL ; ++c) {
 				int const cc = ccol + w*c;
 				CellTile const *tcr, *tc0, *t0r;
-				cell_tile_optimize ((*tile)->ptr_matrix.ptr + i + c,
-						    level - 1, data, cc, cr);
+				if (data->recursion)
+					cell_tile_optimize ((*tile)->ptr_matrix.ptr + i + c,
+							    level - 1, data, cc, cr);
 				tcr = (*tile)->ptr_matrix.ptr[i + c];
 				t0r = (*tile)->ptr_matrix.ptr[i];
 				tc0 = (*tile)->ptr_matrix.ptr[c];
@@ -2887,6 +2890,7 @@ sheet_style_optimize (Sheet *sheet)
 		return;
 
 	data.ss = gnm_sheet_get_size (sheet);
+	data.recursion = TRUE;
 
 	if (debug_style_optimize)
 		g_printerr ("Optimizing %s\n", sheet->name_unquoted);



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