sc/source/core/data/table6.cxx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
New commits: commit f20c91fe2c997bd5966c902ee28f95531435ec26 Author: Eike Rathke <er...@redhat.com> AuthorDate: Sun Aug 8 18:39:39 2021 +0200 Commit: Adolfo Jayme Barrientos <fit...@ubuntu.com> CommitDate: Sun Aug 8 22:50:31 2021 +0200 Resolves: tdf#143759 Limit empty search's empty column to actual search range ... instead of the non-/filtered last row. Change-Id: I9b941af688a8083d472a793a6bc6b6dbb7b916ea Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120176 Reviewed-by: Eike Rathke <er...@redhat.com> Tested-by: Jenkins (cherry picked from commit 15960931988cfd898e14a12d6b9cddaf6d8b0ade) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120135 Reviewed-by: Adolfo Jayme Barrientos <fit...@ubuntu.com> diff --git a/sc/source/core/data/table6.cxx b/sc/source/core/data/table6.cxx index b52247f35e14..fca6dea1c61b 100644 --- a/sc/source/core/data/table6.cxx +++ b/sc/source/core/data/table6.cxx @@ -1081,10 +1081,14 @@ bool ScTable::SearchRangeForAllEmptyCells( if (aCol[nCol].IsEmptyData()) { // The entire column is empty. - for (SCROW nRow = rRange.aStart.Row(); nRow <= rRange.aEnd.Row(); ++nRow) + const SCROW nEndRow = rRange.aEnd.Row(); + for (SCROW nRow = rRange.aStart.Row(); nRow <= nEndRow; ++nRow) { SCROW nLastRow; - if (!RowFiltered(nRow, nullptr, &nLastRow)) + const bool bFiltered = RowFiltered(nRow, nullptr, &nLastRow); + if (nLastRow > nEndRow) + nLastRow = nEndRow; + if (!bFiltered) { rMatchedRanges.Join(ScRange(nCol, nRow, nTab, nCol, nLastRow, nTab)); if (bReplace)