summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2021-11-23 13:35:58 +0100
committerLuboš Luňák <l.lunak@collabora.com>2021-11-23 20:54:44 +0100
commit2e0d5203b0b8133ebc2e6f90c0e0a24962f144f2 (patch)
tree229c3c94396f555ff4b233c9463c4de07d002d31
parentmove code to a separate function (diff)
downloadcore-2e0d5203b0b8133ebc2e6f90c0e0a24962f144f2.tar.gz
core-2e0d5203b0b8133ebc2e6f90c0e0a24962f144f2.zip
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.lunak@collabora.com>
-rw-r--r--sc/source/core/data/table3.cxx8
1 files changed, 4 insertions, 4 deletions
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)
{