diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-04-12 15:40:12 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-04-16 08:22:30 +0200 |
commit | 3d44b720f58366398e7f59c00dba6339712a670f (patch) | |
tree | 452e2be1ea47d4ea5e903c05705ffb6e52ef8577 /svl/source/inc | |
parent | 73c29a2978f967d317235d524aad535a6bafbff0 (diff) |
loplugin:useuniqueptr in SfxItemPool_Impl
Change-Id: Ic3d695dd3ad4ee5ca6537f65d643d8736e3a5700
Reviewed-on: https://gerrit.libreoffice.org/52886
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svl/source/inc')
-rw-r--r-- | svl/source/inc/poolio.hxx | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/svl/source/inc/poolio.hxx b/svl/source/inc/poolio.hxx index 538c89994603..359b88c863dd 100644 --- a/svl/source/inc/poolio.hxx +++ b/svl/source/inc/poolio.hxx @@ -71,14 +71,14 @@ public: struct SfxItemPool_Impl { SfxBroadcaster aBC; - std::vector<SfxPoolItemArray_Impl*> maPoolItems; + std::vector<std::unique_ptr<SfxPoolItemArray_Impl>> maPoolItems; std::vector<SfxItemPoolUser*> maSfxItemPoolUsers; /// ObjectUser section OUString aName; std::vector<SfxPoolItem*> maPoolDefaults; std::vector<SfxPoolItem*>* mpStaticDefaults; SfxItemPool* mpMaster; SfxItemPool* mpSecondary; - sal_uInt16* mpPoolRanges; + std::unique_ptr<sal_uInt16[]> mpPoolRanges; sal_uInt16 mnStart; sal_uInt16 mnEnd; MapUnit eDefMetric; @@ -105,13 +105,9 @@ struct SfxItemPool_Impl void DeleteItems() { - for (auto pPoolItemArray : maPoolItems) - delete pPoolItemArray; maPoolItems.clear(); maPoolDefaults.clear(); - - delete[] mpPoolRanges; - mpPoolRanges = nullptr; + mpPoolRanges.reset(); } // unit testing |