sc/source/ui/inc/drawutil.hxx  |    2 +-
 sc/source/ui/view/drawutil.cxx |    8 ++++----
 sc/source/ui/view/drawvie4.cxx |    4 ++--
 sc/source/ui/view/drawview.cxx |    2 +-
 sc/source/ui/view/gridwin3.cxx |    8 ++++----
 5 files changed, 12 insertions(+), 12 deletions(-)

New commits:
commit 3ea27befefc3de06596fd19d8991e3a7f9d68af1
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Tue Sep 15 10:03:56 2020 +0100
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Wed Sep 16 10:50:12 2020 +0200

    CalcScale never passed a null ScDocument*
    
    Change-Id: Ie916a28a8c1be66db161531daad48ffd0d5d8554
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102834
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caol...@redhat.com>

diff --git a/sc/source/ui/inc/drawutil.hxx b/sc/source/ui/inc/drawutil.hxx
index 0623347f8356..cc921e07aa8f 100644
--- a/sc/source/ui/inc/drawutil.hxx
+++ b/sc/source/ui/inc/drawutil.hxx
@@ -29,7 +29,7 @@ class ScDocument;
 class ScDrawUtil
 {
 public:
-    static void CalcScale( const ScDocument* pDoc, SCTAB nTab,
+    static void CalcScale( const ScDocument& rDoc, SCTAB nTab,
                         SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW 
nEndRow,
                         const OutputDevice* pDev, const Fraction& rZoomX, 
const Fraction& rZoomY,
                         double nPPTX, double nPPTY,
diff --git a/sc/source/ui/view/drawutil.cxx b/sc/source/ui/view/drawutil.cxx
index ff859eb2074c..52f8c7a259cd 100644
--- a/sc/source/ui/view/drawutil.cxx
+++ b/sc/source/ui/view/drawutil.cxx
@@ -24,7 +24,7 @@
 #include <global.hxx>
 #include <viewdata.hxx>
 
-void ScDrawUtil::CalcScale( const ScDocument* pDoc, SCTAB nTab,
+void ScDrawUtil::CalcScale( const ScDocument& rDoc, SCTAB nTab,
                             SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, 
SCROW nEndRow,
                             const OutputDevice* pDev,
                             const Fraction& rZoomX, const Fraction& rZoomY,
@@ -37,7 +37,7 @@ void ScDrawUtil::CalcScale( const ScDocument* pDoc, SCTAB 
nTab,
     long nTwipsY = 0;
     for (SCCOL i=nStartCol; i<nEndCol; i++)
     {
-        sal_uInt16 nWidth = pDoc->GetColWidth(i,nTab);
+        sal_uInt16 nWidth = rDoc.GetColWidth(i,nTab);
         nTwipsX += static_cast<long>(nWidth);
         nPixelX += ScViewData::ToPixel( nWidth, nPPTX );
     }
@@ -45,13 +45,13 @@ void ScDrawUtil::CalcScale( const ScDocument* pDoc, SCTAB 
nTab,
     for (SCROW nRow = nStartRow; nRow <= nEndRow-1; ++nRow)
     {
         SCROW nLastRow = nRow;
-        if (pDoc->RowHidden(nRow, nTab, nullptr, &nLastRow))
+        if (rDoc.RowHidden(nRow, nTab, nullptr, &nLastRow))
         {
             nRow = nLastRow;
             continue;
         }
 
-        sal_uInt16 nHeight = pDoc->GetRowHeight(nRow, nTab);
+        sal_uInt16 nHeight = rDoc.GetRowHeight(nRow, nTab);
         nTwipsY += static_cast<long>(nHeight);
         nPixelY += ScViewData::ToPixel(nHeight, nPPTY);
     }
diff --git a/sc/source/ui/view/drawvie4.cxx b/sc/source/ui/view/drawvie4.cxx
index 66102caa1b23..e4f12a36626a 100644
--- a/sc/source/ui/view/drawvie4.cxx
+++ b/sc/source/ui/view/drawvie4.cxx
@@ -425,8 +425,8 @@ void ScDrawView::CalcNormScale( Fraction& rFractX, 
Fraction& rFractY ) const
         nEndRow = 1000;
 
     Fraction aZoom(1,1);
-    ScDrawUtil::CalcScale( &rDoc, nTab, 0,0, nEndCol,nEndRow, pDev, 
aZoom,aZoom,
-                            nPPTX, nPPTY, rFractX,rFractY );
+    ScDrawUtil::CalcScale( rDoc, nTab, 0,0, nEndCol,nEndRow, pDev, aZoom,aZoom,
+                           nPPTX, nPPTY, rFractX,rFractY );
 }
 
 void ScDrawView::SetMarkedOriginalSize()
diff --git a/sc/source/ui/view/drawview.cxx b/sc/source/ui/view/drawview.cxx
index e372d060bb44..029220816f25 100644
--- a/sc/source/ui/view/drawview.cxx
+++ b/sc/source/ui/view/drawview.cxx
@@ -325,7 +325,7 @@ void ScDrawView::RecalcScale()
         nEndRow = 20;
 
     ScDrawUtil::CalcScale(
-        &rDoc, nTab, 0, 0, nEndCol, nEndRow, pDev, aZoomX, aZoomY, nPPTX, 
nPPTY,
+        rDoc, nTab, 0, 0, nEndCol, nEndRow, pDev, aZoomX, aZoomY, nPPTX, nPPTY,
         aScaleX, aScaleY);
 
     // clear all evtl existing GridOffset vectors
diff --git a/sc/source/ui/view/gridwin3.cxx b/sc/source/ui/view/gridwin3.cxx
index a68f525ff3c7..92cbbcfa8558 100644
--- a/sc/source/ui/view/gridwin3.cxx
+++ b/sc/source/ui/view/gridwin3.cxx
@@ -275,10 +275,10 @@ MapMode ScGridWindow::GetDrawMapMode( bool bForce )
             rDoc.GetTableArea( nTab, nEndCol, nEndRow );
             if (nEndCol<20) nEndCol = 20;
             if (nEndRow<20) nEndRow = 1000;
-            ScDrawUtil::CalcScale( &rDoc, nTab, 0,0, nEndCol,nEndRow, this,
-                                    
pViewData->GetZoomX(),pViewData->GetZoomY(),
-                                    pViewData->GetPPTX(),pViewData->GetPPTY(),
-                                    aScaleX,aScaleY );
+            ScDrawUtil::CalcScale( rDoc, nTab, 0,0, nEndCol,nEndRow, this,
+                                   pViewData->GetZoomX(),pViewData->GetZoomY(),
+                                   pViewData->GetPPTX(),pViewData->GetPPTY(),
+                                   aScaleX,aScaleY );
         }
         aDrawMode.SetScaleX(aScaleX);
         aDrawMode.SetScaleY(aScaleY);
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to