summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2018-03-23 13:13:03 +0100
committerEike Rathke <erack@redhat.com>2018-03-23 13:14:51 +0100
commitc53235ba9aab844c4b16ecf7a28429e256bace6d (patch)
tree311352c29fbe8e94d648926a50c6bc5c407a3771 /sc
parent604df2f608c03a59be65822d27babf0b00714bd6 (diff)
Enable binary search for numeric values again
... as used in LOOKUP and VLOOKUP. This was disabled as a fallout from commit bad266fa06294f1dacec11ec02dfc6ae4ec8cdc4 CommitDate: Mon Feb 22 21:30:28 2016 +0100 ScQueryEntry::GetSearchTextPtr() with SearchType, tdf#72196 that changed the !bRegExp condition (which includes numeric) to bLiteral (which covers only text string) searches. Change-Id: I265286ffe75bc7cd9e660ab82b0e647d82865eb9
Diffstat (limited to 'sc')
-rw-r--r--sc/source/core/data/dociter.cxx5
1 files changed, 3 insertions, 2 deletions
diff --git a/sc/source/core/data/dociter.cxx b/sc/source/core/data/dociter.cxx
index bb4cfe10cbe4..f292d4bd6197 100644
--- a/sc/source/core/data/dociter.cxx
+++ b/sc/source/core/data/dociter.cxx
@@ -1288,8 +1288,9 @@ bool ScQueryCellIterator::FindEqualOrSortedLastInRange( SCCOL& nFoundCol,
bIgnoreMismatchOnLeadingStrings = true;
bool bLiteral = mpParam->eSearchType == utl::SearchParam::SearchType::Normal &&
mpParam->GetEntry(0).GetQueryItem().meType == ScQueryEntry::ByString;
- bool bBinary = bLiteral && mpParam->bByRow && (mpParam->GetEntry(0).eOp ==
- SC_LESS_EQUAL || mpParam->GetEntry(0).eOp == SC_GREATER_EQUAL);
+ bool bBinary = mpParam->bByRow &&
+ (bLiteral || mpParam->GetEntry(0).GetQueryItem().meType == ScQueryEntry::ByValue) &&
+ (mpParam->GetEntry(0).eOp == SC_LESS_EQUAL || mpParam->GetEntry(0).eOp == SC_GREATER_EQUAL);
bool bFound = false;
if (bBinary)
{