sc/source/core/data/table3.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
New commits: commit eca40fca603549b522e927498af069fc461ca3c4 Author: Luboš Luňák <l.lu...@collabora.com> AuthorDate: Mon Dec 13 21:46:46 2021 +0100 Commit: Michael Meeks <michael.me...@collabora.com> CommitDate: Tue Dec 21 14:36:17 2021 +0100 make sure text operations are not queried by (numeric) value E.g. SC_CONTAINS is, according to isPartialTextMatchOp(), a text-only operation, so query it as such and not as a numeric value. This fixes/allows e.g. substring queries on dates. Change-Id: I6c612d9934193828b7a7eabed92f2bfeb385e5a0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126769 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-by: Michael Meeks <michael.me...@collabora.com> diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx index 8a92e17c3977..0704f65c3c4f 100644 --- a/sc/source/core/data/table3.cxx +++ b/sc/source/core/data/table3.cxx @@ -2294,10 +2294,10 @@ public: { } - bool isQueryByValue( + bool isQueryByValue(const ScQueryEntry& rEntry, const ScQueryEntry::Item& rItem, SCCOL nCol, SCROW nRow, ScRefCellValue& rCell) { - if (rItem.meType == ScQueryEntry::ByString) + if (rItem.meType == ScQueryEntry::ByString || isPartialTextMatchOp(rEntry)) return false; if (!rCell.isEmpty()) @@ -2785,7 +2785,7 @@ bool ScTable::ValidQuery( { for (const auto& rItem : rItems) { - if (aEval.isQueryByValue(rItem, nCol, nRow, aCell)) + if (aEval.isQueryByValue(rEntry, rItem, nCol, nRow, aCell)) { std::pair<bool,bool> aThisRes = aEval.compareByValue(aCell, nCol, nRow, rEntry, rItem, pContext);