Kaydet (Commit) 9b0ee7d2 authored tarafından Noel Grandin's avatar Noel Grandin

loplugin:useuniqueptr in MasterPageDescriptor

Change-Id: I54d46aeec5f74ccf088ea33d03fd1d8a2009d43f
Reviewed-on: https://gerrit.libreoffice.org/49211Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst ea385c1a
......@@ -22,6 +22,7 @@
#include <svx/sdrpageuser.hxx>
#include <svx/svdsob.hxx>
#include <memory>
class SdrObject;
class SfxItemSet;
......@@ -45,7 +46,7 @@ namespace sdr
SdrLayerIDSet maVisibleLayers;
// ViewContact part
sdr::contact::ViewContact* mpViewContact;
mutable std::unique_ptr<sdr::contact::ViewContact> mpViewContact;
void operator=(const MasterPageDescriptor& rCandidate) = delete;
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment