summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-09-15 10:03:56 +0100
committerCaolán McNamara <caolanm@redhat.com>2020-09-16 10:50:12 +0200
commit3ea27befefc3de06596fd19d8991e3a7f9d68af1 (patch)
treef04baffcdfcdfef373c31550bad2e66fcec1b4ba
parentCopyStaticToDocument never passed a null ScDocument* (diff)
downloadcore-3ea27befefc3de06596fd19d8991e3a7f9d68af1.tar.gz
core-3ea27befefc3de06596fd19d8991e3a7f9d68af1.zip
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 <caolanm@redhat.com>
-rw-r--r--sc/source/ui/inc/drawutil.hxx2
-rw-r--r--sc/source/ui/view/drawutil.cxx8
-rw-r--r--sc/source/ui/view/drawvie4.cxx4
-rw-r--r--sc/source/ui/view/drawview.cxx2
-rw-r--r--sc/source/ui/view/gridwin3.cxx8
5 files changed, 12 insertions, 12 deletions
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);