diff options
-rw-r--r-- | include/toolkit/awt/vclxgraphics.hxx | 3 | ||||
-rw-r--r-- | toolkit/source/awt/vclxgraphics.cxx | 9 |
2 files changed, 6 insertions, 6 deletions
diff --git a/include/toolkit/awt/vclxgraphics.hxx b/include/toolkit/awt/vclxgraphics.hxx index 3818977d4ba0..8fc980a731de 100644 --- a/include/toolkit/awt/vclxgraphics.hxx +++ b/include/toolkit/awt/vclxgraphics.hxx @@ -32,6 +32,7 @@ #include <vcl/vclenum.hxx> #include <vcl/vclptr.hxx> #include <o3tl/typed_flags_set.hxx> +#include <memory> class OutputDevice; namespace vcl { class Region; } @@ -68,7 +69,7 @@ private: Color maLineColor; Color maFillColor; RasterOp meRasterOp; - vcl::Region* mpClipRegion; + std::unique_ptr<vcl::Region> mpClipRegion; void initAttrs(); 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 ); } |