aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPJ Fanning <fanningpj@apache.org>2023-01-20 12:03:52 +0000
committerPJ Fanning <fanningpj@apache.org>2023-01-20 12:03:52 +0000
commit60872927bd52dc9f9a41c6a4ce9f70d3e1a5c76b (patch)
tree9b3f057489c0ce221a1771921dbbcfd6c350e29a
parent42bbbfc55a671e4ad637c6a92378c5b4dbccbefb (diff)
downloadpoi-60872927bd52dc9f9a41c6a4ce9f70d3e1a5c76b.tar.gz
poi-60872927bd52dc9f9a41c6a4ce9f70d3e1a5c76b.zip
[bug-66433] Boolean functions should blank cells. Thanks to Patrick Böker
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1906836 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--poi/src/main/java/org/apache/poi/ss/formula/functions/BooleanFunction.java3
-rw-r--r--test-data/spreadsheet/BooleanFunctionsTestCaseData.xlsbin30208 -> 30720 bytes
-rw-r--r--test-data/spreadsheet/LookupFunctionsTestCaseData.xlsbin70144 -> 70656 bytes
3 files changed, 2 insertions, 1 deletions
diff --git a/poi/src/main/java/org/apache/poi/ss/formula/functions/BooleanFunction.java b/poi/src/main/java/org/apache/poi/ss/formula/functions/BooleanFunction.java
index 1ef3f9c056..2f0611cfba 100644
--- a/poi/src/main/java/org/apache/poi/ss/formula/functions/BooleanFunction.java
+++ b/poi/src/main/java/org/apache/poi/ss/formula/functions/BooleanFunction.java
@@ -18,6 +18,7 @@
package org.apache.poi.ss.formula.functions;
import org.apache.poi.ss.formula.TwoDEval;
+import org.apache.poi.ss.formula.eval.BlankEval;
import org.apache.poi.ss.formula.eval.BoolEval;
import org.apache.poi.ss.formula.eval.ErrorEval;
import org.apache.poi.ss.formula.eval.EvaluationException;
@@ -91,7 +92,7 @@ public abstract class BooleanFunction implements Function,ArrayFunction {
continue;
}
- if (arg == MissingArgEval.instance) {
+ if (arg == MissingArgEval.instance || arg == BlankEval.instance) {
tempVe = false; // missing parameters are treated as FALSE
} else {
tempVe = OperandResolver.coerceValueToBoolean(arg, false);
diff --git a/test-data/spreadsheet/BooleanFunctionsTestCaseData.xls b/test-data/spreadsheet/BooleanFunctionsTestCaseData.xls
index 44808a5112..ded3ccf195 100644
--- a/test-data/spreadsheet/BooleanFunctionsTestCaseData.xls
+++ b/test-data/spreadsheet/BooleanFunctionsTestCaseData.xls
Binary files differ
diff --git a/test-data/spreadsheet/LookupFunctionsTestCaseData.xls b/test-data/spreadsheet/LookupFunctionsTestCaseData.xls
index d9e9b517d8..8ef287c8c1 100644
--- a/test-data/spreadsheet/LookupFunctionsTestCaseData.xls
+++ b/test-data/spreadsheet/LookupFunctionsTestCaseData.xls
Binary files differ