summaryrefslogtreecommitdiff
path: root/cppcanvas
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-01-16 14:04:57 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-01-19 08:58:46 +0200
commit2b63eea0d4e43ffa23c889519011c870a9a55e58 (patch)
tree3e48b1146365357f3dc58af4942d48f779c5ef96 /cppcanvas
parent42b80f4ed300b08074ed3a6dd48679afd5af760a (diff)
loplugin:useuniqueptr in EMFPPen
Change-Id: Icc50b2ff1d6c7490b67d39aed7c3621b74c03bac
Diffstat (limited to 'cppcanvas')
-rw-r--r--cppcanvas/source/mtfrenderer/emfppen.cxx6
-rw-r--r--cppcanvas/source/mtfrenderer/emfppen.hxx4
2 files changed, 4 insertions, 6 deletions
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<float> compoundArray;
sal_Int32 customStartCapLen;
- EMFPCustomLineCap *customStartCap;
+ std::unique_ptr<EMFPCustomLineCap> customStartCap;
sal_Int32 customEndCapLen;
- EMFPCustomLineCap *customEndCap;
+ std::unique_ptr<EMFPCustomLineCap> customEndCap;
EMFPPen();