Author: nick
Date: Wed Sep 14 14:41:03 2011
New Revision: 1170652

URL: http://svn.apache.org/viewvc?rev=1170652&view=rev
Log:
Apply patch from bug #51809 - correct GTE handling in COUNTIF

Modified:
    poi/trunk/src/documentation/content/xdocs/status.xml
    poi/trunk/src/java/org/apache/poi/ss/formula/functions/Countif.java
    poi/trunk/src/testcases/org/apache/poi/ss/formula/functions/TestSumif.java

Modified: poi/trunk/src/documentation/content/xdocs/status.xml
URL: 
http://svn.apache.org/viewvc/poi/trunk/src/documentation/content/xdocs/status.xml?rev=1170652&r1=1170651&r2=1170652&view=diff
==============================================================================
--- poi/trunk/src/documentation/content/xdocs/status.xml (original)
+++ poi/trunk/src/documentation/content/xdocs/status.xml Wed Sep 14 14:41:03 
2011
@@ -34,6 +34,7 @@
 
     <changes>
         <release version="3.8-beta5" date="2011-??-??">
+           <action dev="poi-developers" type="fix">51809 - correct GTE 
handling in COUNTIF</action>
            <action dev="poi-developers" type="add">Add HWPF API to update 
range text and delete bookmarks</action>
            <action dev="poi-developers" type="add">HWPF Bookmarks tables are 
correctly updated on text updates</action>
            <action dev="poi-developers" type="add">51670 - avoid 
LeftoverDataException when reading .xls files with invalid LabelRecords</action>

Modified: poi/trunk/src/java/org/apache/poi/ss/formula/functions/Countif.java
URL: 
http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/ss/formula/functions/Countif.java?rev=1170652&r1=1170651&r2=1170652&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/ss/formula/functions/Countif.java 
(original)
+++ poi/trunk/src/java/org/apache/poi/ss/formula/functions/Countif.java Wed Sep 
14 14:41:03 2011
@@ -133,7 +133,7 @@ public final class Countif extends Fixed
                                case LT: return cmpResult <  0;
                                case LE: return cmpResult <= 0;
                                case GT: return cmpResult >  0;
-                               case GE: return cmpResult <= 0;
+                               case GE: return cmpResult >= 0;
                        }
                        throw new RuntimeException("Cannot call boolean 
evaluate on non-equality operator '"
                                        + _representation + "'");

Modified: 
poi/trunk/src/testcases/org/apache/poi/ss/formula/functions/TestSumif.java
URL: 
http://svn.apache.org/viewvc/poi/trunk/src/testcases/org/apache/poi/ss/formula/functions/TestSumif.java?rev=1170652&r1=1170651&r2=1170652&view=diff
==============================================================================
--- poi/trunk/src/testcases/org/apache/poi/ss/formula/functions/TestSumif.java 
(original)
+++ poi/trunk/src/testcases/org/apache/poi/ss/formula/functions/TestSumif.java 
Wed Sep 14 14:41:03 2011
@@ -61,6 +61,14 @@ public final class TestSumif extends Tes
                confirm(60.0, arg0, new NumberEval(30.0));
                confirm(70.0, arg0, new NumberEval(30.0), arg2);
                confirm(100.0, arg0, new StringEval(">45"));
+               confirm(100.0, arg0, new StringEval(">=45"));
+               confirm(100.0, arg0, new StringEval(">=50.0"));
+               confirm(140.0, arg0, new StringEval("<45"));
+               confirm(140.0, arg0, new StringEval("<=45"));
+               confirm(140.0, arg0, new StringEval("<=40.0"));
+               confirm(160.0, arg0, new StringEval("<>40.0"));
+               confirm(80.0, arg0, new StringEval("=40.0"));
+               
 
        }
        private static void confirm(double expectedResult, ValueEval...args) {



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to