[Libreoffice-commits] core.git: Branch 'libreoffice-6-0' - sc/source
Eike Rathke
erack at redhat.com
Fri Dec 15 18:37:26 UTC 2017
sc/source/core/tool/dbdata.cxx | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
New commits:
commit 1aa8011d9186dc4d221469058a9fcaf5a93ae765
Author: Eike Rathke <erack at redhat.com>
Date: Fri Dec 15 16:27:54 2017 +0100
Resolves: tdf#113537 don't keep nEndRow=MAXROW if data ends above
Change-Id: I186034cada9718c067fa4dc7f72e2ca55ac06f83
(cherry picked from commit fa100e0abc83b876ca18b4178c44fb1dfc452a5d)
Reviewed-on: https://gerrit.libreoffice.org/46565
Reviewed-by: Eike Rathke <erack at redhat.com>
Tested-by: Jenkins <ci at libreoffice.org>
diff --git a/sc/source/core/tool/dbdata.cxx b/sc/source/core/tool/dbdata.cxx
index 020b2daed980..0b7ebd3b6bfe 100644
--- a/sc/source/core/tool/dbdata.cxx
+++ b/sc/source/core/tool/dbdata.cxx
@@ -624,7 +624,12 @@ void ScDBData::ExtendDataArea(const ScDocument* pDoc)
SCCOL nOldCol1 = nStartCol, nOldCol2 = nEndCol;
SCROW nOldEndRow = nEndRow;
pDoc->GetDataArea(nTable, nStartCol, nStartRow, nEndCol, nEndRow, false, true);
- nEndRow = std::max(nEndRow, nOldEndRow);
+ // nOldEndRow==MAXROW may easily happen when selecting whole columns and
+ // setting an AutoFilter (i.e. creating an anonymous database-range). We
+ // certainly don't want to iterate over nearly a million empty cells, but
+ // keep only an intentionally user selected range.
+ if (nOldEndRow < MAXROW && nEndRow < nOldEndRow)
+ nEndRow = nOldEndRow;
if (nStartCol != nOldCol1 || nEndCol != nOldCol2)
{
SAL_WARN_IF( !maTableColumnNames.empty(), "sc.core", "ScDBData::ExtendDataArea - invalidating column names/offsets");
More information about the Libreoffice-commits
mailing list