diff options
author | Eike Rathke <erack@redhat.com> | 2021-08-08 18:39:39 +0200 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2021-08-16 10:07:51 +0200 |
commit | ab0a4f93200c5d5cb489eb05695a9bcf326ddab4 (patch) | |
tree | 2afff2fecb16ed82c3575ffa30d58d1d855ff953 /sc/source | |
parent | 67ed8a4206d07f7a5a812dad74243cf6b32de770 (diff) |
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 <erack@redhat.com>
Tested-by: Jenkins
(cherry picked from commit 15960931988cfd898e14a12d6b9cddaf6d8b0ade)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120135
Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
Diffstat (limited to 'sc/source')
-rw-r--r-- | sc/source/core/data/table6.cxx | 8 |
1 files changed, 6 insertions, 2 deletions
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) |