[gnumeric] fix interpretation of value comparisons in conditional formatting [#654324]



commit affffe637dcdb5332d5c2dbd48caf87ba2a88f6b
Author: Andreas J Guelzow <aguelzow pyrshep ca>
Date:   Sat Jul 9 23:41:29 2011 -0600

    fix interpretation of value comparisons in conditional formatting [#654324]
    
    2011-07-09  Andreas J. Guelzow <aguelzow pyrshep ca>
    
    	* src/style-conditions.c (gnm_style_conditions_eval): != IS_LESS is
    	not the same as == IS_EQUAL || == IS_GREATER

 ChangeLog              |    5 +++++
 src/style-conditions.c |    4 ++--
 2 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 9b6fe07..62b1404 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2011-07-09  Andreas J. Guelzow <aguelzow pyrshep ca>
+
+	* src/style-conditions.c (gnm_style_conditions_eval): != IS_LESS is
+	not the same as == IS_EQUAL || == IS_GREATER
+
 2011-07-08  Andreas J. Guelzow <aguelzow pyrshep ca>
 
 	* src/style-conditions.c (gnm_style_conditions_delete): new
diff --git a/src/style-conditions.c b/src/style-conditions.c
index 411c497..51e4898 100644
--- a/src/style-conditions.c
+++ b/src/style-conditions.c
@@ -309,7 +309,7 @@ gnm_style_conditions_eval (GnmStyleConditions const *sc, GnmEvalPos const *ep)
 
 				case GNM_STYLE_COND_GT:		use_this = (diff == IS_GREATER); break;
 				case GNM_STYLE_COND_LT:		use_this = (diff == IS_LESS); break;
-				case GNM_STYLE_COND_GTE:	use_this = (diff != IS_LESS); break;
+				case GNM_STYLE_COND_GTE:	use_this = (diff == IS_GREATER || diff == IS_EQUAL); break;
 				case GNM_STYLE_COND_BETWEEN:
 					if (diff == IS_LESS)
 						break;
@@ -317,7 +317,7 @@ gnm_style_conditions_eval (GnmStyleConditions const *sc, GnmEvalPos const *ep)
 					val = gnm_expr_top_eval (cond->texpr[1], ep, GNM_EXPR_EVAL_SCALAR_NON_EMPTY);
 					diff = value_compare (cv, val, TRUE);
 					/* fall through */
-				case GNM_STYLE_COND_LTE:	use_this = (diff != IS_GREATER); break;
+				case GNM_STYLE_COND_LTE:	use_this = (diff == IS_LESS || diff == IS_EQUAL); break;
 				}
 			} else if (cv && VALUE_IS_STRING (cv)) {
 				char const *valstring = value_peek_string (val);



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