diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-10-18 13:32:59 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-10-19 11:04:37 +0200 |
commit | 3991cd38484883b8544be908b6834564345fd0f1 (patch) | |
tree | dfc1577d3cefe069aedc54a21824aac11081ea36 | |
parent | 049fc31e5557eada26a39bf8a06bfdb8f1cbb205 (diff) |
use std::unique_ptr in SvxUnoPropertyMapProvider
Change-Id: I774718e74bdf2e022a01188a05c8928813ad653f
Reviewed-on: https://gerrit.libreoffice.org/43524
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r-- | include/svx/unoprov.hxx | 3 | ||||
-rw-r--r-- | svx/source/unodraw/unoprov.cxx | 6 |
2 files changed, 4 insertions, 5 deletions
diff --git a/include/svx/unoprov.hxx b/include/svx/unoprov.hxx index 7d2651c6bfd8..8a2d7d977f51 100644 --- a/include/svx/unoprov.hxx +++ b/include/svx/unoprov.hxx @@ -26,6 +26,7 @@ #include <svx/svxdllapi.h> #include <editeng/unoipset.hxx> #include <rtl/ref.hxx> +#include <memory> class SvxItemPropertySet; @@ -84,7 +85,7 @@ public: class SVX_DLLPUBLIC SvxUnoPropertyMapProvider { SfxItemPropertyMapEntry const * aMapArr[SVXMAP_END]; - SvxItemPropertySet* aSetArr[SVXMAP_END]; + std::unique_ptr<SvxItemPropertySet> aSetArr[SVXMAP_END]; public: SvxUnoPropertyMapProvider(); ~SvxUnoPropertyMapProvider(); diff --git a/svx/source/unodraw/unoprov.cxx b/svx/source/unodraw/unoprov.cxx index abe266261ec6..ff8a6f48cd1d 100644 --- a/svx/source/unodraw/unoprov.cxx +++ b/svx/source/unodraw/unoprov.cxx @@ -902,8 +902,6 @@ SvxUnoPropertyMapProvider::SvxUnoPropertyMapProvider() SvxUnoPropertyMapProvider::~SvxUnoPropertyMapProvider() { - for(SvxItemPropertySet* p : aSetArr) - delete p; } @@ -949,8 +947,8 @@ const SfxItemPropertyMapEntry* SvxUnoPropertyMapProvider::GetMap(sal_uInt16 nPro const SvxItemPropertySet* SvxUnoPropertyMapProvider::GetPropertySet(sal_uInt16 nPropertyId, SfxItemPool& rPool) { if( !aSetArr[nPropertyId] ) - aSetArr[nPropertyId] = new SvxItemPropertySet( GetMap( nPropertyId ), rPool ); - return aSetArr[nPropertyId]; + aSetArr[nPropertyId].reset(new SvxItemPropertySet( GetMap( nPropertyId ), rPool )); + return aSetArr[nPropertyId].get(); } /** maps the vcl MapUnit enum to a API constant MeasureUnit. |