From 3522572e5a050ba15b88616c2b7aad88e7e1b53e Mon Sep 17 00:00:00 2001 From: DarkByt31 Date: Wed, 4 Mar 2020 18:43:35 +0530 Subject: ReplaceNullTransformation::Transform fix nEndRow Change-Id: Ib041694e8de2113f11b3ef1b8553334e0d9e1c37 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89969 Reviewed-by: Markus Mohrhard Tested-by: Jenkins --- sc/source/ui/dataprovider/datatransformation.cxx | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/sc/source/ui/dataprovider/datatransformation.cxx b/sc/source/ui/dataprovider/datatransformation.cxx index 0d5cc107ef33..cce23e1c1505 100644 --- a/sc/source/ui/dataprovider/datatransformation.cxx +++ b/sc/source/ui/dataprovider/datatransformation.cxx @@ -32,11 +32,9 @@ DataTransformation::~DataTransformation() SCROW DataTransformation::getLastRow(const ScDocument& rDoc, SCCOL nCol) { - SCROW nStartRow = 0; SCROW nEndRow = MAXROW; - rDoc.ShrinkToDataArea(0, nCol, nStartRow, nCol, nEndRow); - return nEndRow; + return rDoc.GetLastDataRow(0, nCol, nCol, nEndRow); } ColumnRemoveTransformation::ColumnRemoveTransformation(const std::set& rColumns): @@ -673,15 +671,10 @@ void ReplaceNullTransformation::Transform(ScDocument& rDoc) const if (mnCol.empty()) return; - SCROW nEndRow = 0; - for(auto& rCol : mnCol) - { - nEndRow = getLastRow(rDoc, rCol); - } - for(auto& rCol : mnCol) { - for (SCROW nRow = 0; nRow < nEndRow; ++nRow) + SCROW nEndRow = getLastRow(rDoc, rCol); + for (SCROW nRow = 0; nRow <= nEndRow; ++nRow) { CellType eType; rDoc.GetCellType(rCol, nRow, 0, eType); -- cgit