[gnumeric] Style optimizer: allow turning it off.
- From: Morten Welinder <mortenw src gnome org>
- To: svn-commits-list gnome org
- Subject: [gnumeric] Style optimizer: allow turning it off.
- Date: Mon, 8 Jun 2009 22:31:48 -0400 (EDT)
commit ed82a1058ad64cfdae418bddc4b39b77dd95bcea
Author: Morten Welinder <terra gnome org>
Date: Mon Jun 8 22:31:13 2009 -0400
Style optimizer: allow turning it off.
---
ChangeLog | 8 ++++++++
src/sheet-style.c | 5 ++++-
2 files changed, 12 insertions(+), 1 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 9d7d0ba..b0d2fa0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2009-06-08 Morten Welinder <terra gnome org>
+
+ * src/sheet-style.c (sample_styles): Check equality using
+ gnm_style_equal to match the optimizer, if even == ought to be
+ good enough.
+ (sheet_style_optimize): Add no-style-optimize debug flag doing the
+ obvious.
+
2009-06-08 Andreas J. Guelzow <aguelzow pyrshep ca>
* src/print.c (compute_sheet_pages): make sure we have
diff --git a/src/sheet-style.c b/src/sheet-style.c
index 2a23d69..a1c0049 100644
--- a/src/sheet-style.c
+++ b/src/sheet-style.c
@@ -2768,7 +2768,7 @@ sample_styles (Sheet *sheet)
while (1) {
GnmStyle const *mstyle = sheet_style_get (sheet, c, r);
- if (res == NULL || mstyle != res->data) {
+ if (res == NULL || !gnm_style_equal (mstyle, res->data)) {
gnm_style_ref (mstyle);
res = g_slist_prepend (res, GINT_TO_POINTER (c));
res = g_slist_prepend (res, GINT_TO_POINTER (r));
@@ -2840,6 +2840,9 @@ sheet_style_optimize (Sheet *sheet)
g_return_if_fail (IS_SHEET (sheet));
+ if (gnm_debug_flag ("no-style-optimize"))
+ return;
+
data.ss = gnm_sheet_get_size (sheet);
data.debug = gnm_debug_flag ("style-optimize");
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]