diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-01-15 16:24:35 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-01-17 10:16:35 +0200 |
commit | 4a64a68c6828b7cf0e57ee40817f4ab1a8a75aea (patch) | |
tree | 9413a1ca5d166535c96850a630a1b6ff53479875 | |
parent | f063d364050b2595bc3b29f416cd365b13b809fe (diff) |
loplugin:useuniqueptr in TreeControlPeer
Change-Id: I40bf5d147b4617ab225d190643b70d29ae34b7ec
-rw-r--r-- | svtools/source/uno/treecontrolpeer.cxx | 6 | ||||
-rw-r--r-- | svtools/source/uno/treecontrolpeer.hxx | 2 |
2 files changed, 3 insertions, 5 deletions
diff --git a/svtools/source/uno/treecontrolpeer.cxx b/svtools/source/uno/treecontrolpeer.cxx index 6bca0137bc19..36ef421c39ed 100644 --- a/svtools/source/uno/treecontrolpeer.cxx +++ b/svtools/source/uno/treecontrolpeer.cxx @@ -150,7 +150,6 @@ TreeControlPeer::~TreeControlPeer() { if( mpTreeImpl ) mpTreeImpl->Clear(); - delete mpTreeNodeMap; } @@ -160,7 +159,7 @@ void TreeControlPeer::addEntry( UnoTreeListEntry* pEntry ) { if( !mpTreeNodeMap ) { - mpTreeNodeMap = new TreeNodeMap; + mpTreeNodeMap.reset( new TreeNodeMap ); } (*mpTreeNodeMap)[ pEntry->mxNode ] = pEntry; @@ -207,8 +206,7 @@ vcl::Window* TreeControlPeer::createVclControl( vcl::Window* pParent, sal_Int64 /** called from the UnoTreeListBoxImpl when it gets deleted */ void TreeControlPeer::disposeControl() { - delete mpTreeNodeMap; - mpTreeNodeMap = nullptr; + mpTreeNodeMap.reset(); mpTreeImpl = nullptr; } diff --git a/svtools/source/uno/treecontrolpeer.hxx b/svtools/source/uno/treecontrolpeer.hxx index fc4b7e24348e..e2bcffaf7fec 100644 --- a/svtools/source/uno/treecontrolpeer.hxx +++ b/svtools/source/uno/treecontrolpeer.hxx @@ -165,7 +165,7 @@ private: OUString msDefaultExpandedGraphicURL; Image maDefaultExpandedImage; Image maDefaultCollapsedImage; - TreeNodeMap* mpTreeNodeMap; + std::unique_ptr<TreeNodeMap> mpTreeNodeMap; css::uno::Reference< css::graphic::XGraphicProvider > mxGraphicProvider; }; |