From 2b63eea0d4e43ffa23c889519011c870a9a55e58 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Tue, 16 Jan 2018 14:04:57 +0200 Subject: loplugin:useuniqueptr in EMFPPen Change-Id: Icc50b2ff1d6c7490b67d39aed7c3621b74c03bac --- cppcanvas/source/mtfrenderer/emfppen.cxx | 6 ++---- cppcanvas/source/mtfrenderer/emfppen.hxx | 4 ++-- 2 files changed, 4 insertions(+), 6 deletions(-) (limited to 'cppcanvas') diff --git a/cppcanvas/source/mtfrenderer/emfppen.cxx b/cppcanvas/source/mtfrenderer/emfppen.cxx index 2bd005e4aab4..aa34a527a33d 100644 --- a/cppcanvas/source/mtfrenderer/emfppen.cxx +++ b/cppcanvas/source/mtfrenderer/emfppen.cxx @@ -91,8 +91,6 @@ namespace cppcanvas EMFPPen::~EMFPPen() { - delete customStartCap; - delete customEndCap; } void EMFPPen::SetStrokeWidth(rendering::StrokeAttributes& rStrokeAttributes, ImplRenderer const & rR, const OutDevState& rState) @@ -267,7 +265,7 @@ namespace cppcanvas SAL_INFO("cppcanvas.emf", "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 ;-) @@ -282,7 +280,7 @@ namespace cppcanvas SAL_INFO("cppcanvas.emf", "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/cppcanvas/source/mtfrenderer/emfppen.hxx b/cppcanvas/source/mtfrenderer/emfppen.hxx index d5abfa7e823c..75878df4805d 100644 --- a/cppcanvas/source/mtfrenderer/emfppen.hxx +++ b/cppcanvas/source/mtfrenderer/emfppen.hxx @@ -52,9 +52,9 @@ namespace cppcanvas 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