summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2018-03-23 13:13:03 +0100
committerCaolán McNamara <caolanm@redhat.com>2018-03-26 18:08:30 +0200
commitc3ca9d933b289df49e45f223493f3a22a1f74d14 (patch)
treec5baad5b81294af333a60d068fc92f7e73b2dc81 /sc
parent74d438f716d9cef165c78f950d4c53a46c37503c (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 (cherry picked from commit c53235ba9aab844c4b16ecf7a28429e256bace6d) Reviewed-on: https://gerrit.libreoffice.org/51779 Tested-by: Eike Rathke <erack@redhat.com> Reviewed-by: Dennis Francis <dennis.francis@collabora.co.uk> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
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 13abb17a9fc4..96af2dbc3150 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)
{