Kaydet (Commit) 42b80f4e authored tarafından Noel Grandin's avatar Noel Grandin

loplugin:useuniqueptr in EMFPRegion

Change-Id: I19107173318180ec08864e523f4065181eac00cc
üst 6f2db2c1
...@@ -58,10 +58,6 @@ namespace cppcanvas ...@@ -58,10 +58,6 @@ namespace cppcanvas
EMFPRegion::~EMFPRegion() EMFPRegion::~EMFPRegion()
{ {
if (combineMode) {
delete[] combineMode;
combineMode = nullptr;
}
} }
void EMFPRegion::Read(SvStream& s) void EMFPRegion::Read(SvStream& s)
...@@ -77,7 +73,7 @@ namespace cppcanvas ...@@ -77,7 +73,7 @@ namespace cppcanvas
if (parts<0 || sal_uInt32(parts)>SAL_MAX_INT32 / sizeof(sal_Int32)) if (parts<0 || sal_uInt32(parts)>SAL_MAX_INT32 / sizeof(sal_Int32))
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++) { for (int i = 0; i < parts; i++) {
s.ReadInt32(combineMode[i]); s.ReadInt32(combineMode[i]);
......
...@@ -27,7 +27,7 @@ namespace cppcanvas ...@@ -27,7 +27,7 @@ namespace cppcanvas
struct EMFPRegion : public EMFPObject struct EMFPRegion : public EMFPObject
{ {
sal_Int32 parts; sal_Int32 parts;
sal_Int32 *combineMode; std::unique_ptr<sal_Int32[]> combineMode;
sal_Int32 initialState; sal_Int32 initialState;
float ix, iy, iw, ih; float ix, iy, iw, ih;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment