diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-01-30 10:50:58 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-02-05 07:56:06 +0100 |
commit | 9b0ee7d25fd405153fa783cbc0b1658368a22355 (patch) | |
tree | 36583bcf9f93c98c1546648bc9745f259c3e14cf /svx | |
parent | ea385c1a9f3a9faaa0f3e2408082bfe914b2518d (diff) |
loplugin:useuniqueptr in MasterPageDescriptor
Change-Id: I54d46aeec5f74ccf088ea33d03fd1d8a2009d43f
Reviewed-on: https://gerrit.libreoffice.org/49211
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/svdraw/sdrmasterpagedescriptor.cxx | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/svx/source/svdraw/sdrmasterpagedescriptor.cxx b/svx/source/svdraw/sdrmasterpagedescriptor.cxx index 3bc645fb4dc7..89f042c087e0 100644 --- a/svx/source/svdraw/sdrmasterpagedescriptor.cxx +++ b/svx/source/svdraw/sdrmasterpagedescriptor.cxx @@ -45,11 +45,7 @@ namespace sdr // de-register at used page maUsedPage.RemovePageUser(*this); - if(mpViewContact) - { - delete mpViewContact; - mpViewContact = nullptr; - } + mpViewContact.reset(); } // ViewContact part @@ -57,8 +53,8 @@ namespace sdr { if(!mpViewContact) { - const_cast< MasterPageDescriptor* >(this)->mpViewContact = - new sdr::contact::ViewContactOfMasterPageDescriptor(*const_cast< MasterPageDescriptor* >(this)); + mpViewContact.reset( + new sdr::contact::ViewContactOfMasterPageDescriptor(*const_cast< MasterPageDescriptor* >(this)) ); } return *mpViewContact; |