[Libreoffice-commits] core.git: sc/source

DarkByt31 (via logerrit) logerrit at kemper.freedesktop.org
Sat Mar 7 13:27:18 UTC 2020


 sc/source/ui/dataprovider/datatransformation.cxx |   13 +++----------
 1 file changed, 3 insertions(+), 10 deletions(-)

New commits:
commit 3522572e5a050ba15b88616c2b7aad88e7e1b53e
Author:     DarkByt31 <avihs.29 at gmail.com>
AuthorDate: Wed Mar 4 18:43:35 2020 +0530
Commit:     Markus Mohrhard <markus.mohrhard at googlemail.com>
CommitDate: Sat Mar 7 14:26:42 2020 +0100

    ReplaceNullTransformation::Transform fix nEndRow
    
    Change-Id: Ib041694e8de2113f11b3ef1b8553334e0d9e1c37
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89969
    Reviewed-by: Markus Mohrhard <markus.mohrhard at googlemail.com>
    Tested-by: Jenkins

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);


More information about the Libreoffice-commits mailing list