diff options
author | DarkByt31 <avihs.29@gmail.com> | 2020-03-04 18:43:35 +0530 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2020-03-07 14:26:42 +0100 |
commit | 3522572e5a050ba15b88616c2b7aad88e7e1b53e (patch) | |
tree | 97c5c212b5eac24cb67ebbdf32474dfbc7339175 /sc | |
parent | f9b31a49027a8fa5e8fa094a3b62866832426466 (diff) |
ReplaceNullTransformation::Transform fix nEndRow
Change-Id: Ib041694e8de2113f11b3ef1b8553334e0d9e1c37
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89969
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Tested-by: Jenkins
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/ui/dataprovider/datatransformation.cxx | 13 |
1 files 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<SCCOL>& 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); |