[Libreoffice-commits] core.git: sc/source

Eike Rathke erack at redhat.com
Fri Mar 23 12:15:15 UTC 2018


 sc/source/core/data/dociter.cxx |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

New commits:
commit c53235ba9aab844c4b16ecf7a28429e256bace6d
Author: Eike Rathke <erack at redhat.com>
Date:   Fri Mar 23 13:13:03 2018 +0100

    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

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)
     {


More information about the Libreoffice-commits mailing list