diff options
author | Noel Grandin <noel@peralex.com> | 2014-06-18 12:14:29 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2014-06-24 11:34:21 +0200 |
commit | e2080e70fe8b085f18e868e46340454720fa94ca (patch) | |
tree | 4038d1d57b41b68a47d5ebbbe6ad390648ec6303 /reportdesign | |
parent | f910280b8704ed9c289150a4ca3c8d60e15d0d97 (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 'reportdesign')
-rw-r--r-- | reportdesign/source/ui/inc/ScrollHelper.hxx | 6 | ||||
-rw-r--r-- | reportdesign/source/ui/misc/UITools.cxx | 8 | ||||
-rw-r--r-- | reportdesign/source/ui/report/ViewsWindow.cxx | 6 | ||||
-rw-r--r-- | reportdesign/source/ui/report/dlgedfunc.cxx | 8 |
4 files changed, 14 insertions, 14 deletions
diff --git a/reportdesign/source/ui/inc/ScrollHelper.hxx b/reportdesign/source/ui/inc/ScrollHelper.hxx index 2ef981425e04..db8e73e1364e 100644 --- a/reportdesign/source/ui/inc/ScrollHelper.hxx +++ b/reportdesign/source/ui/inc/ScrollHelper.hxx @@ -81,10 +81,10 @@ namespace rptui inline Point getThumbPos() const { return Point(m_aHScroll.GetThumbPos(),m_aVScroll.GetThumbPos())/*m_aScrollOffset*/; } inline const OReportWindow& getReportWindow() const { return m_aReportWindow; } - void setTotalSize(sal_Int32 _nWidth ,sal_Int32 _nHeight); + void setTotalSize(sal_Int32 _nWidth, sal_Int32 _nHeight); inline Size getTotalSize() const { return m_aTotalPixelSize; } - inline ScrollBar* GetHScroll() { return &m_aHScroll; } - inline ScrollBar* GetVScroll() { return &m_aVScroll; } + inline ScrollBar& GetHScroll() { return m_aHScroll; } + inline ScrollBar& GetVScroll() { return m_aVScroll; } // forwards void SetMode( DlgEdMode _eMode ); diff --git a/reportdesign/source/ui/misc/UITools.cxx b/reportdesign/source/ui/misc/UITools.cxx index 7533d843aee0..134de05e92b0 100644 --- a/reportdesign/source/ui/misc/UITools.cxx +++ b/reportdesign/source/ui/misc/UITools.cxx @@ -266,8 +266,8 @@ namespace { uno::Reference< beans::XPropertySetInfo> xInfo = _xShape->getPropertySetInfo(); SvxUnoPropertyMapProvider aMap; - const SfxItemPropertyMap* pPropertyMap = aMap.GetPropertySet(SVXMAP_CUSTOMSHAPE, SdrObject::GetGlobalDrawObjectItemPool())->getPropertyMap(); - PropertyEntryVector_t aPropVector = pPropertyMap->getPropertyEntries(); + const SfxItemPropertyMap& rPropertyMap = aMap.GetPropertySet(SVXMAP_CUSTOMSHAPE, SdrObject::GetGlobalDrawObjectItemPool())->getPropertyMap(); + PropertyEntryVector_t aPropVector = rPropertyMap.getPropertyEntries(); PropertyEntryVector_t::const_iterator aIt = aPropVector.begin(); while( aIt != aPropVector.end() ) { @@ -291,8 +291,8 @@ namespace { const uno::Reference< beans::XPropertySetInfo> xInfo = _xShape->getPropertySetInfo(); SvxUnoPropertyMapProvider aMap; - const SfxItemPropertyMap* pPropertyMap = aMap.GetPropertySet(SVXMAP_CUSTOMSHAPE, SdrObject::GetGlobalDrawObjectItemPool())->getPropertyMap(); - PropertyEntryVector_t aPropVector = pPropertyMap->getPropertyEntries(); + const SfxItemPropertyMap& rPropertyMap = aMap.GetPropertySet(SVXMAP_CUSTOMSHAPE, SdrObject::GetGlobalDrawObjectItemPool())->getPropertyMap(); + PropertyEntryVector_t aPropVector = rPropertyMap.getPropertyEntries(); PropertyEntryVector_t::const_iterator aIt = aPropVector.begin(); while( aIt != aPropVector.end() ) { diff --git a/reportdesign/source/ui/report/ViewsWindow.cxx b/reportdesign/source/ui/report/ViewsWindow.cxx index 5715f3700912..e30b797ad74e 100644 --- a/reportdesign/source/ui/report/ViewsWindow.cxx +++ b/reportdesign/source/ui/report/ViewsWindow.cxx @@ -1444,9 +1444,9 @@ void OViewsWindow::handleKey(const KeyCode& _rCode) { // scroll page OScrollWindowHelper* pScrollWindow = getView()->getScrollWindow(); - ScrollBar* pScrollBar = ( nCode == KEY_LEFT || nCode == KEY_RIGHT ) ? pScrollWindow->GetHScroll() : pScrollWindow->GetVScroll(); - if ( pScrollBar && pScrollBar->IsVisible() ) - pScrollBar->DoScrollAction(( nCode == KEY_RIGHT || nCode == KEY_UP ) ? SCROLL_LINEUP : SCROLL_LINEDOWN ); + ScrollBar& rScrollBar = ( nCode == KEY_LEFT || nCode == KEY_RIGHT ) ? pScrollWindow->GetHScroll() : pScrollWindow->GetVScroll(); + if ( rScrollBar.IsVisible() ) + rScrollBar.DoScrollAction(( nCode == KEY_RIGHT || nCode == KEY_UP ) ? SCROLL_LINEUP : SCROLL_LINEDOWN ); return; } TSectionsMap::const_iterator aIter = m_aSections.begin(); diff --git a/reportdesign/source/ui/report/dlgedfunc.cxx b/reportdesign/source/ui/report/dlgedfunc.cxx index 024b7cce9e95..ffc1a6b84dd8 100644 --- a/reportdesign/source/ui/report/dlgedfunc.cxx +++ b/reportdesign/source/ui/report/dlgedfunc.cxx @@ -94,8 +94,8 @@ void DlgEdFunc::ForceScroll( const Point& rPos ) aWorkArea = pScrollWindow->PixelToLogic( aWorkArea ); if( !aOutRect.IsInside( rPos ) && aWorkArea.IsInside( rPos ) ) { - ScrollBar* pHScroll = pScrollWindow->GetHScroll(); - ScrollBar* pVScroll = pScrollWindow->GetVScroll(); + ScrollBar& rHScroll = pScrollWindow->GetHScroll(); + ScrollBar& rVScroll = pScrollWindow->GetVScroll(); ScrollType eH = SCROLL_LINEDOWN,eV = SCROLL_LINEDOWN; if( rPos.X() < aOutRect.Left() ) eH = SCROLL_LINEUP; @@ -107,8 +107,8 @@ void DlgEdFunc::ForceScroll( const Point& rPos ) else if( rPos.Y() <= aOutRect.Bottom() ) eV = SCROLL_DONTKNOW; - pHScroll->DoScrollAction(eH); - pVScroll->DoScrollAction(eV); + rHScroll.DoScrollAction(eH); + rVScroll.DoScrollAction(eV); } aScrollTimer.Start(); |