summaryrefslogtreecommitdiff
path: root/toolkit
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-01-15 16:12:24 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-01-17 10:16:35 +0200
commit474b4bbff3af7c6b69554ee332c7f26c68cc440d (patch)
treee49b0166b5e32ba8f80319a6897608add9605442 /toolkit
parentfa286c8934745410aee34ee61ff2b44a67b5e36c (diff)
loplugin:useuniqueptr in VCLXGraphics
Change-Id: If753b871831a9954048becd0aca73769e23163ec
Diffstat (limited to 'toolkit')
-rw-r--r--toolkit/source/awt/vclxgraphics.cxx9
1 files changed, 4 insertions, 5 deletions
diff --git a/toolkit/source/awt/vclxgraphics.cxx b/toolkit/source/awt/vclxgraphics.cxx
index fac87df6f571..e8496a105b6f 100644
--- a/toolkit/source/awt/vclxgraphics.cxx
+++ b/toolkit/source/awt/vclxgraphics.cxx
@@ -79,7 +79,7 @@ VCLXGraphics::~VCLXGraphics()
}
}
- delete mpClipRegion;
+ mpClipRegion.reset();
SolarMutexGuard g;
mpOutputDevice.reset();
@@ -227,11 +227,10 @@ void VCLXGraphics::setClipRegion( const uno::Reference< awt::XRegion >& rxRegion
{
SolarMutexGuard aGuard;
- delete mpClipRegion;
if ( rxRegion.is() )
- mpClipRegion = new vcl::Region( VCLUnoHelper::GetRegion( rxRegion ) );
+ mpClipRegion.reset( new vcl::Region( VCLUnoHelper::GetRegion( rxRegion ) ) );
else
- mpClipRegion = nullptr;
+ mpClipRegion.reset();
}
void VCLXGraphics::intersectClipRegion( const uno::Reference< awt::XRegion >& rxRegion )
@@ -242,7 +241,7 @@ void VCLXGraphics::intersectClipRegion( const uno::Reference< awt::XRegion >& rx
{
vcl::Region aRegion( VCLUnoHelper::GetRegion( rxRegion ) );
if ( !mpClipRegion )
- mpClipRegion = new vcl::Region( aRegion );
+ mpClipRegion.reset( new vcl::Region( aRegion ) );
else
mpClipRegion->Intersect( aRegion );
}