diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-01-16 14:04:01 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-01-19 08:58:46 +0200 |
commit | 42b80f4ed300b08074ed3a6dd48679afd5af760a (patch) | |
tree | 43917fdb76bb28ae1f44c362b12c7084d58b762d /cppcanvas | |
parent | 6f2db2c124c3054d2895c797f2564cff51bdfdda (diff) |
loplugin:useuniqueptr in EMFPRegion
Change-Id: I19107173318180ec08864e523f4065181eac00cc
Diffstat (limited to 'cppcanvas')
-rw-r--r-- | cppcanvas/source/mtfrenderer/emfpregion.cxx | 6 | ||||
-rw-r--r-- | cppcanvas/source/mtfrenderer/emfpregion.hxx | 2 |
2 files changed, 2 insertions, 6 deletions
diff --git a/cppcanvas/source/mtfrenderer/emfpregion.cxx b/cppcanvas/source/mtfrenderer/emfpregion.cxx index efb7effe9800..6c548cd2e9be 100644 --- a/cppcanvas/source/mtfrenderer/emfpregion.cxx +++ b/cppcanvas/source/mtfrenderer/emfpregion.cxx @@ -58,10 +58,6 @@ namespace cppcanvas EMFPRegion::~EMFPRegion() { - if (combineMode) { - delete[] combineMode; - combineMode = nullptr; - } } void EMFPRegion::Read(SvStream& s) @@ -77,7 +73,7 @@ namespace cppcanvas if (parts<0 || sal_uInt32(parts)>SAL_MAX_INT32 / sizeof(sal_Int32)) parts = SAL_MAX_INT32 / sizeof(sal_Int32); - combineMode = new sal_Int32[parts]; + combineMode.reset( new sal_Int32[parts] ); for (int i = 0; i < parts; i++) { s.ReadInt32(combineMode[i]); diff --git a/cppcanvas/source/mtfrenderer/emfpregion.hxx b/cppcanvas/source/mtfrenderer/emfpregion.hxx index 876aebcdbd67..5df1639f63d1 100644 --- a/cppcanvas/source/mtfrenderer/emfpregion.hxx +++ b/cppcanvas/source/mtfrenderer/emfpregion.hxx @@ -27,7 +27,7 @@ namespace cppcanvas struct EMFPRegion : public EMFPObject { sal_Int32 parts; - sal_Int32 *combineMode; + std::unique_ptr<sal_Int32[]> combineMode; sal_Int32 initialState; float ix, iy, iw, ih; |