summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-06-22 14:09:04 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-06-25 09:13:14 +0200
commita3c2e5c2ad7ee26044e47277149a15653647eb0e (patch)
tree529f9e1d22852f1d487d492f5f7cd0ed0ffa1cf2 /sd
parent14b306398463dbd4c1af511d38513eac05c3672f (diff)
loplugin:useuniqueptr in SdLayerManager
Change-Id: I95c17965e7de1daf0b548220326e05371b71b1ae Reviewed-on: https://gerrit.libreoffice.org/56336 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sd')
-rw-r--r--sd/source/ui/unoidl/unolayer.cxx6
-rw-r--r--sd/source/ui/unoidl/unolayer.hxx2
2 files changed, 3 insertions, 5 deletions
diff --git a/sd/source/ui/unoidl/unolayer.cxx b/sd/source/ui/unoidl/unolayer.cxx
index b6c6d9a1c968..c7cb0f0387aa 100644
--- a/sd/source/ui/unoidl/unolayer.cxx
+++ b/sd/source/ui/unoidl/unolayer.cxx
@@ -415,7 +415,7 @@ void SAL_CALL SdLayer::removeEventListener( const uno::Reference< lang::XEventLi
SdLayerManager::SdLayerManager( SdXImpressDocument& rMyModel ) throw()
:mpModel( &rMyModel)
{
- mpLayers = new SvUnoWeakContainer;
+ mpLayers.reset(new SvUnoWeakContainer);
}
SdLayerManager::~SdLayerManager() throw()
@@ -433,9 +433,7 @@ void SAL_CALL SdLayerManager::dispose( )
if( mpLayers )
{
mpLayers->dispose();
-
- delete mpLayers;
- mpLayers = nullptr;
+ mpLayers.reset();
}
}
diff --git a/sd/source/ui/unoidl/unolayer.hxx b/sd/source/ui/unoidl/unolayer.hxx
index 8217337a5b5d..4388105c6c4e 100644
--- a/sd/source/ui/unoidl/unolayer.hxx
+++ b/sd/source/ui/unoidl/unolayer.hxx
@@ -165,7 +165,7 @@ public:
private:
SdXImpressDocument* mpModel;
- SvUnoWeakContainer* mpLayers;
+ std::unique_ptr<SvUnoWeakContainer> mpLayers;
::sd::View* GetView() const throw();
::sd::DrawDocShell* GetDocShell() const throw() { return mpModel->mpDocShell; }