Browse Source

refactor LookupUtils

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1895546 13f79535-47bb-0310-9956-ffa450edef68
tags/REL_5_2_0
PJ Fanning 2 years ago
parent
commit
37573b3b4e

+ 6
- 2
poi/src/main/java/org/apache/poi/ss/formula/functions/LookupUtils.java View File

@@ -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());
}
}
}


Loading…
Cancel
Save