diff options
author | Michael Stahl <mstahl@redhat.com> | 2013-03-13 22:28:52 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2013-03-13 22:29:46 +0100 |
commit | 38d3e115c159f19f22de73ece1abe609d75a041e (patch) | |
tree | 63ffe74cb9b8fcc52617b616d02cc2504a0d0e11 /svtools | |
parent | coverity#704144: Resource leak in object (diff) | |
download | core-38d3e115c159f19f22de73ece1abe609d75a041e.tar.gz core-38d3e115c159f19f22de73ece1abe609d75a041e.zip |
vcl: make Region ctors explicit to prevent overloading desasters
Change-Id: Id36d125b4940418833bec31a4710d6cd545629e0
Diffstat (limited to 'svtools')
-rw-r--r-- | svtools/source/brwbox/editbrowsebox.cxx | 2 | ||||
-rw-r--r-- | svtools/source/contnr/imivctl1.cxx | 8 | ||||
-rw-r--r-- | svtools/source/graphic/grfmgr.cxx | 4 | ||||
-rw-r--r-- | svtools/source/toolpanel/paneltabbar.cxx | 7 |
4 files changed, 12 insertions, 9 deletions
diff --git a/svtools/source/brwbox/editbrowsebox.cxx b/svtools/source/brwbox/editbrowsebox.cxx index 444fc9805edd..36930e7a6f4b 100644 --- a/svtools/source/brwbox/editbrowsebox.cxx +++ b/svtools/source/brwbox/editbrowsebox.cxx @@ -363,7 +363,7 @@ namespace svt Point aPos( rRect.TopLeft() ); if ( ( aImageSize.Width() > rRect.GetWidth() ) || ( aImageSize.Height() > rRect.GetHeight() ) ) - rDev.SetClipRegion(rRect); + rDev.SetClipRegion(Region(rRect)); if ( aImageSize.Width() < rRect.GetWidth() ) aPos.X() += ( rRect.GetWidth() - aImageSize.Width() ) / 2; diff --git a/svtools/source/contnr/imivctl1.cxx b/svtools/source/contnr/imivctl1.cxx index b84ab9ed9308..0c9e425de2e0 100644 --- a/svtools/source/contnr/imivctl1.cxx +++ b/svtools/source/contnr/imivctl1.cxx @@ -690,7 +690,7 @@ void SvxIconChoiceCtrl_Impl::Paint( const Rectangle& rRect ) sal_Bool bResetClipRegion = sal_False; if( !pView->IsClipRegion() ) { - Rectangle aOutputArea( GetOutputRect() ); + Region const aOutputArea( GetOutputRect() ); bResetClipRegion = sal_True; pView->SetClipRegion( aOutputArea ); } @@ -740,7 +740,7 @@ void SvxIconChoiceCtrl_Impl::RepaintEntries( sal_uInt16 nEntryFlagsMask ) if( !pView->IsClipRegion() ) { bResetClipRegion = sal_True; - pView->SetClipRegion( aOutRect ); + pView->SetClipRegion(Region(aOutRect)); } for( size_t nCur = 0; nCur < nCount; nCur++ ) { @@ -1832,7 +1832,7 @@ void SvxIconChoiceCtrl_Impl::PaintEntry( SvxIconChoiceCtrlEntry* pEntry, const P Rectangle aOutputArea( GetOutputRect() ); if( aOutputArea.IsOver(aTextRect) || aOutputArea.IsOver(aBmpRect) ) { - pView->SetClipRegion( aOutputArea ); + pView->SetClipRegion(Region(aOutputArea)); bResetClipRegion = sal_True; } } @@ -2764,7 +2764,7 @@ void SvxIconChoiceCtrl_Impl::SelectRect( const Rectangle& rRect, bool bAdd, if( !pView->IsClipRegion() ) { bResetClipRegion = sal_True; - pView->SetClipRegion( GetOutputRect() ); + pView->SetClipRegion(Region(GetOutputRect())); } for( size_t nPos = 0; nPos < nCount; nPos++ ) diff --git a/svtools/source/graphic/grfmgr.cxx b/svtools/source/graphic/grfmgr.cxx index 438c2df61a28..52f8b52baaaa 100644 --- a/svtools/source/graphic/grfmgr.cxx +++ b/svtools/source/graphic/grfmgr.cxx @@ -554,7 +554,7 @@ bool GraphicObject::Draw( OutputDevice* pOut, const Point& rPt, const Size& rSz, } else { - pOut->IntersectClipRegion( aClipPolyPoly ); + pOut->IntersectClipRegion(Region(aClipPolyPoly)); } } } @@ -693,7 +693,7 @@ sal_Bool GraphicObject::StartAnimation( OutputDevice* pOut, const Point& rPt, co if( bRectClip ) pOut->IntersectClipRegion( aClipPolyPoly.GetBoundRect() ); else - pOut->IntersectClipRegion( aClipPolyPoly ); + pOut->IntersectClipRegion(Region(aClipPolyPoly)); } } diff --git a/svtools/source/toolpanel/paneltabbar.cxx b/svtools/source/toolpanel/paneltabbar.cxx index f7922a3b30ce..34ef11563289 100644 --- a/svtools/source/toolpanel/paneltabbar.cxx +++ b/svtools/source/toolpanel/paneltabbar.cxx @@ -471,7 +471,10 @@ namespace svt :m_rDevice( i_rImpl.m_rTabBar ) { m_rDevice.Push( PUSH_CLIPREGION ); - m_rDevice.SetClipRegion( i_rImpl.m_aNormalizer.getTransformed( i_rImpl.m_aGeometry.getItemsRect(), i_rImpl.m_eTabAlignment ) ); + m_rDevice.SetClipRegion(Region( + i_rImpl.m_aNormalizer.getTransformed( + i_rImpl.m_aGeometry.getItemsRect(), + i_rImpl.m_eTabAlignment ))); } ~ClipItemRegion() @@ -1042,7 +1045,7 @@ namespace svt // background const Rectangle aNormalizedPaintArea( m_pImpl->m_aNormalizer.getNormalized( i_rRect, m_pImpl->m_eTabAlignment ) ); m_pImpl->m_aRenderDevice.Push( PUSH_CLIPREGION ); - m_pImpl->m_aRenderDevice.SetClipRegion( aNormalizedPaintArea ); + m_pImpl->m_aRenderDevice.SetClipRegion(Region(aNormalizedPaintArea)); m_pImpl->m_pRenderer->renderBackground(); m_pImpl->m_aRenderDevice.Pop(); m_pImpl->CopyFromRenderDevice( aNormalizedPaintArea ); |