Kaydet (Commit) fa100e0a authored tarafından Eike Rathke's avatar Eike Rathke

Resolves: tdf#113537 don't keep nEndRow=MAXROW if data ends above

Change-Id: I186034cada9718c067fa4dc7f72e2ca55ac06f83
üst 1c2aaa98
......@@ -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");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment