[gnumeric] sheet-style.c: if verification fails, abort.



commit 5374fd396a195b5762bd357337759deca4b793f6
Author: Morten Welinder <terra gnome org>
Date:   Sat May 9 18:52:08 2009 -0400

    sheet-style.c: if verification fails, abort.
---
 ChangeLog         |    5 +++++
 src/sheet-style.c |    8 +++++++-
 2 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index b80947e..05e4dde 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2009-05-09  Morten Welinder  <terra gnome org>
+
+	* src/sheet-style.c (verify_styles): Abort if anything is found to
+	be wrong.
+
 2009-05-10  Andreas J. Guelzow <aguelzow pyrshep ca>
 
 	* src/cell.c (gnm_cell_is_nonsingleton_array): don't use
diff --git a/src/sheet-style.c b/src/sheet-style.c
index fbf441e..8dbb399 100644
--- a/src/sheet-style.c
+++ b/src/sheet-style.c
@@ -2806,7 +2806,7 @@ static void
 verify_styles (GSList *pre, GSList *post)
 {
 	GSList *lpre, *lpost;
-	gboolean silent = FALSE;
+	gboolean silent = FALSE, bad = FALSE;
 
 	for (lpre = pre, lpost = post;
 	     lpre || lpost;
@@ -2821,13 +2821,16 @@ verify_styles (GSList *pre, GSList *post)
 
 		if (!silent) {
 			if (!spre || !spost) {
+				bad = TRUE;
 				g_warning ("Style optimizer failure at end!");
 				silent = TRUE;
 			} else if (cpre != cpost || rpre != rpost) {
+				bad = TRUE;
 				g_warning ("Style optimizer position conflict at %s!",
 					   cell_coord_name (cpre, rpre));
 				silent = TRUE;
 			} else if (!gnm_style_equal (spre, spost)) {
+				bad = TRUE;
 				g_warning ("Style optimizer failure at %s!",
 					   cell_coord_name (cpre, rpre));
 			}
@@ -2839,6 +2842,9 @@ verify_styles (GSList *pre, GSList *post)
 
 	g_slist_free (pre);
 	g_slist_free (post);
+
+	if (bad)
+		abort ();
 }
 
 void



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