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 /vcl | |
parent | 913f175b321caf7a99957fd7c4dc536f4101ab53 (diff) |
vcl: make Region ctors explicit to prevent overloading desasters
Change-Id: Id36d125b4940418833bec31a4710d6cd545629e0
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/inc/vcl/region.hxx | 12 | ||||
-rw-r--r-- | vcl/source/control/spinbtn.cxx | 4 | ||||
-rw-r--r-- | vcl/source/control/spinfld.cxx | 6 | ||||
-rw-r--r-- | vcl/source/filter/sgvmain.cxx | 8 | ||||
-rw-r--r-- | vcl/source/gdi/gdimtf.cxx | 4 | ||||
-rw-r--r-- | vcl/source/gdi/outdev4.cxx | 2 | ||||
-rw-r--r-- | vcl/source/gdi/outdev6.cxx | 2 | ||||
-rw-r--r-- | vcl/source/gdi/outdevnative.cxx | 2 | ||||
-rw-r--r-- | vcl/source/gdi/region.cxx | 4 | ||||
-rw-r--r-- | vcl/source/window/menu.cxx | 2 |
10 files changed, 24 insertions, 22 deletions
diff --git a/vcl/inc/vcl/region.hxx b/vcl/inc/vcl/region.hxx index acc69d86e1e8..9a5ed6884c58 100644 --- a/vcl/inc/vcl/region.hxx +++ b/vcl/inc/vcl/region.hxx @@ -79,12 +79,12 @@ public: // public within vcl #endif public: - Region(); - Region( RegionType eType ); - Region( const Rectangle& rRect ); - Region( const Polygon& rPolygon ); - Region( const PolyPolygon& rPolyPoly ); - Region( const basegfx::B2DPolyPolygon& ); + explicit Region(); + explicit Region( RegionType eType ); + explicit Region( const Rectangle& rRect ); + explicit Region( const Polygon& rPolygon ); + explicit Region( const PolyPolygon& rPolyPoly ); + explicit Region( const basegfx::B2DPolyPolygon& ); Region( const Region& rRegion ); ~Region(); diff --git a/vcl/source/control/spinbtn.cxx b/vcl/source/control/spinbtn.cxx index 20aac8e68934..897c04216f61 100644 --- a/vcl/source/control/spinbtn.cxx +++ b/vcl/source/control/spinbtn.cxx @@ -505,13 +505,13 @@ long SpinButton::PreNotify( NotifyEvent& rNEvt ) Region aRgn( GetActiveClipRegion() ); if( pLastRect ) { - SetClipRegion( *pLastRect ); + SetClipRegion(Region(*pLastRect)); Paint( *pLastRect ); SetClipRegion( aRgn ); } if( pRect ) { - SetClipRegion( *pRect ); + SetClipRegion(Region(*pRect)); Paint( *pRect ); SetClipRegion( aRgn ); } diff --git a/vcl/source/control/spinfld.cxx b/vcl/source/control/spinfld.cxx index 604c386587ba..d50c521b84f0 100644 --- a/vcl/source/control/spinfld.cxx +++ b/vcl/source/control/spinfld.cxx @@ -117,7 +117,7 @@ sal_Bool ImplDrawNativeSpinfield( Window *pWin, const SpinbuttonValue& rSpinbutt bNativeOK = pBorder->DrawNativeControl( CTRL_SPINBOX, PART_ENTIRE_CONTROL, aRgn, CTRL_STATE_ENABLED, rSpinbuttonValue, rtl::OUString() ); - pBorder->SetClipRegion( oldRgn ); + pBorder->SetClipRegion(Region(oldRgn)); } } return bNativeOK; @@ -925,13 +925,13 @@ long SpinField::PreNotify( NotifyEvent& rNEvt ) Region aRgn( GetActiveClipRegion() ); if( pLastRect ) { - SetClipRegion( *pLastRect ); + SetClipRegion(Region(*pLastRect)); Paint( *pLastRect ); SetClipRegion( aRgn ); } if( pRect ) { - SetClipRegion( *pRect ); + SetClipRegion(Region(*pRect)); Paint( *pRect ); SetClipRegion( aRgn ); } diff --git a/vcl/source/filter/sgvmain.cxx b/vcl/source/filter/sgvmain.cxx index aea90fbb9ee1..a29952486095 100644 --- a/vcl/source/filter/sgvmain.cxx +++ b/vcl/source/filter/sgvmain.cxx @@ -585,14 +585,14 @@ void DrawSlideCirc(sal_Int16 cx, sal_Int16 cy, sal_Int16 rx, sal_Int16 ry, ObjAr b=Int1+sal_Int16((sal_Int32)(Int2-Int1)*(sal_Int32)(i-y1) /(sal_Int32)(y2-y1+1)); if (b!=b0) { SgfAreaColorIntens(F.FMuster,(sal_uInt8)Col1,(sal_uInt8)Col2,(sal_uInt8)b0,rOut); - rOut.SetClipRegion(Rectangle(x1,i0,x2,i-1)); + rOut.SetClipRegion(Region(Rectangle(x1,i0,x2,i-1))); rOut.DrawEllipse(Rectangle(x1,y1,x2,y2)); i0=i; b0=b; } i++; } SgfAreaColorIntens(F.FMuster,(sal_uInt8)Col1,(sal_uInt8)Col2,(sal_uInt8)Int2,rOut); - rOut.SetClipRegion(Rectangle(x1,i0,x2,y2)); + rOut.SetClipRegion(Region(Rectangle(x1,i0,x2,y2))); rOut.DrawEllipse(Rectangle(x1,y1,x2,y2)); rOut.SetClipRegion(ClipMerk); } break; @@ -604,14 +604,14 @@ void DrawSlideCirc(sal_Int16 cx, sal_Int16 cy, sal_Int16 rx, sal_Int16 ry, ObjAr b=Int1+sal_Int16((sal_Int32)(Int2-Int1)*(sal_Int32)(i-x1) /(sal_Int32)(x2-x1+1)); if (b!=b0) { SgfAreaColorIntens(F.FMuster,(sal_uInt8)Col1,(sal_uInt8)Col2,(sal_uInt8)b0,rOut); - rOut.SetClipRegion(Rectangle(i0,y1,i-1,y2)); + rOut.SetClipRegion(Region(Rectangle(i0,y1,i-1,y2))); rOut.DrawEllipse(Rectangle(x1,y1,x2,y2)); i0=i; b0=b; } i++; } SgfAreaColorIntens(F.FMuster,(sal_uInt8)Col1,(sal_uInt8)Col2,(sal_uInt8)Int2,rOut); - rOut.SetClipRegion(Rectangle(i0,y1,x2,y2)); + rOut.SetClipRegion(Region(Rectangle(i0,y1,x2,y2))); rOut.DrawEllipse(Rectangle(x1,y1,x2,y2)); rOut.SetClipRegion(ClipMerk); } break; diff --git a/vcl/source/gdi/gdimtf.cxx b/vcl/source/gdi/gdimtf.cxx index a561d64814eb..e2d4c1d7c1f6 100644 --- a/vcl/source/gdi/gdimtf.cxx +++ b/vcl/source/gdi/gdimtf.cxx @@ -1403,7 +1403,9 @@ void GDIMetaFile::Rotate( long nAngle10 ) case( META_ISECTRECTCLIPREGION_ACTION ): { MetaISectRectClipRegionAction* pAct = (MetaISectRectClipRegionAction*) pAction; - aMtf.AddAction( new MetaISectRegionClipRegionAction( ImplGetRotatedPolygon( pAct->GetRect(), aRotAnchor, aRotOffset, fSin, fCos ) ) ); + aMtf.AddAction( new MetaISectRegionClipRegionAction(Region( + ImplGetRotatedPolygon( pAct->GetRect(), aRotAnchor, + aRotOffset, fSin, fCos )) ) ); } break; diff --git a/vcl/source/gdi/outdev4.cxx b/vcl/source/gdi/outdev4.cxx index 390220d4f158..f487e808442f 100644 --- a/vcl/source/gdi/outdev4.cxx +++ b/vcl/source/gdi/outdev4.cxx @@ -800,7 +800,7 @@ void OutputDevice::DrawGradient( const PolyPolygon& rPolyPoly, if( OUTDEV_PRINTER == meOutDevType ) { Push( PUSH_CLIPREGION ); - IntersectClipRegion( rPolyPoly ); + IntersectClipRegion(Region(rPolyPoly)); DrawGradient( aRect, rGradient ); Pop(); } diff --git a/vcl/source/gdi/outdev6.cxx b/vcl/source/gdi/outdev6.cxx index 821d9cecb94c..685f33e9f506 100644 --- a/vcl/source/gdi/outdev6.cxx +++ b/vcl/source/gdi/outdev6.cxx @@ -348,7 +348,7 @@ void OutputDevice::DrawTransparent( const PolyPolygon& rPolyPoly, } Push( PUSH_CLIPREGION | PUSH_LINECOLOR ); - IntersectClipRegion( rPolyPoly ); + IntersectClipRegion(Region(rPolyPoly)); SetLineColor( GetFillColor() ); const sal_Bool bOldMap = mbMap; EnableMapMode( sal_False ); diff --git a/vcl/source/gdi/outdevnative.cxx b/vcl/source/gdi/outdevnative.cxx index 5a35e3145733..449af1b598f0 100644 --- a/vcl/source/gdi/outdevnative.cxx +++ b/vcl/source/gdi/outdevnative.cxx @@ -295,7 +295,7 @@ sal_Bool OutputDevice::DrawNativeControl( ControlType nType, Region aTestRegion( GetActiveClipRegion() ); aTestRegion.Intersect( rControlRegion ); - if( aTestRegion == rControlRegion ) + if (aTestRegion == Region(rControlRegion)) nState |= CTRL_CACHING_ALLOWED; // control is not clipped, caching allowed sal_Bool bRet = mpGraphics->DrawNativeControl(nType, nPart, screenRegion, nState, *aScreenCtrlValue, aCaption, this ); diff --git a/vcl/source/gdi/region.cxx b/vcl/source/gdi/region.cxx index f12b3c0aa43d..b46972a7383a 100644 --- a/vcl/source/gdi/region.cxx +++ b/vcl/source/gdi/region.cxx @@ -2322,7 +2322,7 @@ sal_Bool Region::IsInside( const Rectangle& rRect ) const return sal_False; // create region from rectangle and intersect own region - Region aRegion = rRect; + Region aRegion(rRect); aRegion.Exclude( *this ); // rectangle is inside if exclusion is empty @@ -2341,7 +2341,7 @@ sal_Bool Region::IsOver( const Rectangle& rRect ) const // Can we optimize this ??? - is used in StarDraw for brushes pointers // Why we have no IsOver for Regions ??? // create region from rectangle and intersect own region - Region aRegion = rRect; + Region aRegion(rRect); aRegion.Intersect( *this ); // rectangle is over if include is not empty diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx index 1b286440357b..c8e02adada28 100644 --- a/vcl/source/window/menu.cxx +++ b/vcl/source/window/menu.cxx @@ -4038,7 +4038,7 @@ Region MenuFloatingWindow::ImplCalcClipRegion( sal_Bool bIncludeLogo ) const if ( pMenu && pMenu->pLogo && !bIncludeLogo ) aRect.Left() += pMenu->pLogo->aBitmap.GetSizePixel().Width(); - Region aRegion = aRect; + Region aRegion(aRect); if ( pMenu && pMenu->pLogo && bIncludeLogo && nScrollerHeight ) aRegion.Union( Rectangle( Point(), Size( pMenu->pLogo->aBitmap.GetSizePixel().Width(), aOutSz.Height() ) ) ); |