summaryrefslogtreecommitdiff
path: root/sc/source/ui/view/pfuncache.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2014-06-18 12:14:29 +0200
committerNoel Grandin <noel@peralex.com>2014-06-24 11:34:21 +0200
commite2080e70fe8b085f18e868e46340454720fa94ca (patch)
tree4038d1d57b41b68a47d5ebbbe6ad390648ec6303 /sc/source/ui/view/pfuncache.cxx
parentf910280b8704ed9c289150a4ca3c8d60e15d0d97 (diff)
new compilerplugin returnbyref
Find places where we are returning a pointer to something, where we can be returning a reference. e.g. class A { struct X x; public X* getX() { return &x; } } which can be: public X& getX() { return x; } Change-Id: I796fd23fd36a18aedf6e36bc28f8fab4f518c6c7
Diffstat (limited to 'sc/source/ui/view/pfuncache.cxx')
-rw-r--r--sc/source/ui/view/pfuncache.cxx18
1 files changed, 9 insertions, 9 deletions
diff --git a/sc/source/ui/view/pfuncache.cxx b/sc/source/ui/view/pfuncache.cxx
index 062716a3a2da..404d4dc3a1c1 100644
--- a/sc/source/ui/view/pfuncache.cxx
+++ b/sc/source/ui/view/pfuncache.cxx
@@ -47,8 +47,8 @@ ScPrintFuncCache::ScPrintFuncCache( ScDocShell* pD, const ScMarkData& rMark,
pSelRange = &aRange;
}
- ScDocument* pDoc = pDocSh->GetDocument();
- SCTAB nTabCount = pDoc->GetTableCount();
+ ScDocument& rDoc = pDocSh->GetDocument();
+ SCTAB nTabCount = rDoc.GetTableCount();
// avoid repeated progress bars if row heights for all sheets are needed
if ( nTabCount > 1 && rMark.GetSelectCount() == nTabCount )
@@ -94,8 +94,8 @@ void ScPrintFuncCache::InitLocations( const ScMarkData& rMark, OutputDevice* pDe
long nRenderer = 0; // 0-based physical page number across sheets
long nTabStart = 0;
- ScDocument* pDoc = pDocSh->GetDocument();
- SCTAB nTabCount = pDoc->GetTableCount();
+ ScDocument& rDoc = pDocSh->GetDocument();
+ SCTAB nTabCount = rDoc.GetTableCount();
ScMarkData::const_iterator itr = rMark.begin(), itrEnd = rMark.end();
for (; itr != itrEnd && (*itr) < nTabCount; ++itr)
{
@@ -112,7 +112,7 @@ void ScPrintFuncCache::InitLocations( const ScMarkData& rMark, OutputDevice* pDe
aPage.SetTotalRange( Range(0,RANGE_MAX) );
aPage.Select( aPageRange );
- ScPreviewLocationData aLocData( pDoc, pDev );
+ ScPreviewLocationData aLocData( &rDoc, pDev );
aFunc.DoPrint( aPage, nTabStart, nDisplayStart, false, &aLocData );
ScRange aCellRange;
@@ -150,8 +150,8 @@ bool ScPrintFuncCache::IsSameSelection( const ScPrintSelectionStatus& rStatus )
SCTAB ScPrintFuncCache::GetTabForPage( long nPage ) const
{
- ScDocument* pDoc = pDocSh->GetDocument();
- SCTAB nTabCount = pDoc->GetTableCount();
+ ScDocument& rDoc = pDocSh->GetDocument();
+ SCTAB nTabCount = rDoc.GetTableCount();
SCTAB nTab = 0;
while ( nTab < nTabCount && nPage >= nPages[nTab] )
nPage -= nPages[nTab++];
@@ -173,10 +173,10 @@ long ScPrintFuncCache::GetDisplayStart( SCTAB nTab ) const
//! merge with lcl_GetDisplayStart in preview?
long nDisplayStart = 0;
- ScDocument* pDoc = pDocSh->GetDocument();
+ ScDocument& rDoc = pDocSh->GetDocument();
for (SCTAB i=0; i<nTab; i++)
{
- if ( pDoc->NeedPageResetAfterTab(i) )
+ if ( rDoc.NeedPageResetAfterTab(i) )
nDisplayStart = 0;
else
{