From fb3091bfc73cb321017f47d87dc8cb782b9a58d8 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Tue, 16 Jan 2018 14:11:21 +0200 Subject: loplugin:useuniqueptr in EMFPPen Change-Id: I2c3c7be4bc3b43f03c45724e7a002e862b50f24b --- drawinglayer/source/tools/emfppen.cxx | 6 ++---- drawinglayer/source/tools/emfppen.hxx | 4 ++-- 2 files changed, 4 insertions(+), 6 deletions(-) (limited to 'drawinglayer') diff --git a/drawinglayer/source/tools/emfppen.cxx b/drawinglayer/source/tools/emfppen.cxx index ac9d63a202d9..096380ee8307 100644 --- a/drawinglayer/source/tools/emfppen.cxx +++ b/drawinglayer/source/tools/emfppen.cxx @@ -82,8 +82,6 @@ namespace emfplushelper EMFPPen::~EMFPPen() { - delete customStartCap; - delete customEndCap; } void EMFPPen::SetStrokeWidth(rendering::StrokeAttributes& rStrokeAttributes, EmfPlusHelperData const & rR, const ::basegfx::B2DHomMatrix& mapModeTransform) @@ -297,7 +295,7 @@ namespace emfplushelper SAL_INFO("drawinglayer", "EMF+\t\tcustomStartCapLen: " << customStartCapLen); sal_uInt64 const pos = s.Tell(); - customStartCap = new EMFPCustomLineCap(); + customStartCap.reset( new EMFPCustomLineCap() ); customStartCap->Read(s, rR); // maybe we don't read everything yet, play it safe ;-) @@ -314,7 +312,7 @@ namespace emfplushelper SAL_INFO("drawinglayer", "EMF+\t\tcustomEndCapLen: " << customEndCapLen); sal_uInt64 const pos = s.Tell(); - customEndCap = new EMFPCustomLineCap(); + customEndCap.reset( new EMFPCustomLineCap() ); customEndCap->Read(s, rR); // maybe we don't read everything yet, play it safe ;-) diff --git a/drawinglayer/source/tools/emfppen.hxx b/drawinglayer/source/tools/emfppen.hxx index d3087bdd5412..5c0818bf8ba5 100644 --- a/drawinglayer/source/tools/emfppen.hxx +++ b/drawinglayer/source/tools/emfppen.hxx @@ -60,9 +60,9 @@ namespace emfplushelper sal_Int32 alignment; std::vector compoundArray; sal_Int32 customStartCapLen; - EMFPCustomLineCap *customStartCap; + std::unique_ptr customStartCap; sal_Int32 customEndCapLen; - EMFPCustomLineCap *customEndCap; + std::unique_ptr customEndCap; EMFPPen(); -- cgit