diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-07-10 13:57:53 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-07-11 16:01:28 +0200 |
commit | 673347af7d37f6789855c17732c9980d91ec6240 (patch) | |
tree | 4447a73900c50db2f949755eca64a91ac2d9a385 /sfx2/source/explorer | |
parent | 0bc97adb82f14d6ec22f868422cbfe000afec402 (diff) |
loplugin:useuniqueptr in scaddins..svx
Change-Id: I309f98f6b820103a926e9fe94d67d0aff6eb6476
Reviewed-on: https://gerrit.libreoffice.org/39754
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sfx2/source/explorer')
-rw-r--r-- | sfx2/source/explorer/nochaos.cxx | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sfx2/source/explorer/nochaos.cxx b/sfx2/source/explorer/nochaos.cxx index 3023b3bd9f28..a499764c1d87 100644 --- a/sfx2/source/explorer/nochaos.cxx +++ b/sfx2/source/explorer/nochaos.cxx @@ -22,8 +22,9 @@ #include <svl/itempool.hxx> #include <svl/poolitem.hxx> #include <svl/stritem.hxx> -#include <nochaos.hxx> #include <sfx2/sfxuno.hxx> +#include <nochaos.hxx> +#include <memory> #define WID_CHAOS_START 500 @@ -37,7 +38,7 @@ class CntStaticPoolDefaults_Impl { static const sal_uInt32 m_nItems = 1; std::vector<SfxPoolItem*>* m_pDefaults; - SfxItemInfo* m_pItemInfos; + std::unique_ptr<SfxItemInfo[]> m_pItemInfos; private: inline void Insert( SfxPoolItem* pItem ); @@ -49,7 +50,7 @@ public: CntStaticPoolDefaults_Impl& operator=(const CntStaticPoolDefaults_Impl&) = delete; std::vector<SfxPoolItem*>* GetDefaults() const { return m_pDefaults; } - const SfxItemInfo* GetItemInfos() const { return m_pItemInfos; } + const SfxItemInfo* GetItemInfos() const { return m_pItemInfos.get(); } }; @@ -174,7 +175,6 @@ CntStaticPoolDefaults_Impl::~CntStaticPoolDefaults_Impl() delete (*m_pDefaults)[ n ]; delete m_pDefaults; - delete [] m_pItemInfos; } @@ -182,7 +182,7 @@ CntStaticPoolDefaults_Impl::CntStaticPoolDefaults_Impl() : m_pDefaults( new std::vector<SfxPoolItem*>( m_nItems, nullptr ) ), m_pItemInfos( new SfxItemInfo [ m_nItems ] ) { - memset( m_pItemInfos, 0, sizeof( SfxItemInfo ) * m_nItems ); + memset( m_pItemInfos.get(), 0, sizeof( SfxItemInfo ) * m_nItems ); Insert( new SfxStringItem( WID_CHAOS_START, OUString() ) ); } |