sc/source/core/data/table3.cxx |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 2e0d5203b0b8133ebc2e6f90c0e0a24962f144f2
Author:     Luboš Luňák <l.lu...@collabora.com>
AuthorDate: Tue Nov 23 13:35:58 2021 +0100
Commit:     Luboš Luňák <l.lu...@collabora.com>
CommitDate: Tue Nov 23 20:54:44 2021 +0100

    do not wait for condition that's not needed
    
    When not querying for the test equal condition, it's pointless
    to keep searching for it to become true only to throw it away.
    
    Change-Id: Ie861bac141f80025e95753fb8b1202498df17383
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125733
    Tested-by: Jenkins
    Reviewed-by: Luboš Luňák <l.lu...@collabora.com>

diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx
index d0311e1d191e..9c926fadf4fb 100644
--- a/sc/source/core/data/table3.cxx
+++ b/sc/source/core/data/table3.cxx
@@ -2957,7 +2957,7 @@ public:
 };
 
 std::pair<bool,bool> validQueryProcessEntry(SCROW nRow, SCCOL nCol, SCTAB 
nTab, const ScQueryParam& rParam,
-    ScRefCellValue& aCell, const ScInterpreterContext* pContext, 
QueryEvaluator& aEval,
+    ScRefCellValue& aCell, bool* pbTestEqualCondition, const 
ScInterpreterContext* pContext, QueryEvaluator& aEval,
     const ScQueryEntry& rEntry )
 {
     std::pair<bool,bool> aRes(false, false);
@@ -3012,7 +3012,7 @@ std::pair<bool,bool> validQueryProcessEntry(SCROW nRow, 
SCCOL nCol, SCTAB nTab,
             aRes.second |= aThisRes.second;
         }
 
-        if (aRes.first && aRes.second)
+        if (aRes.first && (aRes.second || pbTestEqualCondition == nullptr))
             break;
     }
     return aRes;
@@ -3058,8 +3058,8 @@ bool ScTable::ValidQuery(
         else
             aCell = GetCellValue(nCol, nRow);
 
-        std::pair<bool,bool> aRes = validQueryProcessEntry(nRow, nCol, nTab, 
rParam, aCell, pContext,
-            aEval, rEntry);
+        std::pair<bool,bool> aRes = validQueryProcessEntry(nRow, nCol, nTab, 
rParam, aCell,
+            pbTestEqualCondition, pContext, aEval, rEntry);
 
         if (nPos == -1)
         {

Reply via email to