aboutsummaryrefslogtreecommitdiffstats
path: root/poi
diff options
context:
space:
mode:
authorPJ Fanning <fanningpj@apache.org>2021-12-03 12:08:50 +0000
committerPJ Fanning <fanningpj@apache.org>2021-12-03 12:08:50 +0000
commit37573b3b4e6c0b6ad55959a013748c434bd45513 (patch)
tree0fa0327a2c8da3a5c371025d3e0b6969add2af9c /poi
parent51d563c25061eec0fa9d15bd7c4a962eb406b4fe (diff)
downloadpoi-37573b3b4e6c0b6ad55959a013748c434bd45513.tar.gz
poi-37573b3b4e6c0b6ad55959a013748c434bd45513.zip
refactor LookupUtils
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1895546 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'poi')
-rw-r--r--poi/src/main/java/org/apache/poi/ss/formula/functions/LookupUtils.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/poi/src/main/java/org/apache/poi/ss/formula/functions/LookupUtils.java b/poi/src/main/java/org/apache/poi/ss/formula/functions/LookupUtils.java
index be113ec4bd..7ba7b18a11 100644
--- a/poi/src/main/java/org/apache/poi/ss/formula/functions/LookupUtils.java
+++ b/poi/src/main/java/org/apache/poi/ss/formula/functions/LookupUtils.java
@@ -623,7 +623,7 @@ public final class LookupUtils {
}
public static int xlookupIndexOfValue(ValueEval lookupValue, ValueVector vector, MatchMode matchMode, SearchMode searchMode) throws EvaluationException {
- LookupValueComparer lookupComparer = createTolerantLookupComparer(lookupValue, true, true);
+ LookupValueComparer lookupComparer = createTolerantLookupComparer(lookupValue, matchMode != MatchMode.WildcardMatch, true);
int result;
if (searchMode == SearchMode.BinarySearchForward || searchMode == SearchMode.BinarySearchBackward) {
result = binarySearchIndexOfValue(lookupComparer, vector, matchMode);
@@ -757,7 +757,11 @@ public final class LookupUtils {
}
break;
}
- bsi.narrowSearch(i, result.isLessThan());
+ if (result.isTypeMismatch()) {
+ handleMidValueTypeMismatch(lookupComparer, vector, bsi, i);
+ } else {
+ bsi.narrowSearch(i, result.isLessThan());
+ }
}
}