[Libreoffice-commits] core.git: include/svx svx/source
Noel Grandin
noel.grandin at collabora.co.uk
Thu May 3 06:22:02 UTC 2018
include/svx/svdpage.hxx | 2 +-
svx/source/svdraw/svdpage.cxx | 5 ++---
2 files changed, 3 insertions(+), 4 deletions(-)
New commits:
commit 2b2223730b680a006b3380d3d44d59548b7bce65
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date: Wed May 2 10:21:22 2018 +0200
loplugin:useuniqueptr in SdrPage
Change-Id: Ie3a471e67b7596c967a38b26c250f82f16b80e61
Reviewed-on: https://gerrit.libreoffice.org/53754
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/include/svx/svdpage.hxx b/include/svx/svdpage.hxx
index f6899da1a86d..a4cc40feebd4 100644
--- a/include/svx/svdpage.hxx
+++ b/include/svx/svdpage.hxx
@@ -421,7 +421,7 @@ public:
protected:
// new MasterPageDescriptorVector
- sdr::MasterPageDescriptor* mpMasterPageDescriptor;
+ std::unique_ptr<sdr::MasterPageDescriptor> mpMasterPageDescriptor;
SdrLayerIDSet aPrefVisiLayers;
sal_uInt16 nPageNum;
diff --git a/svx/source/svdraw/svdpage.cxx b/svx/source/svdraw/svdpage.cxx
index 71207b6d4f88..a5d16568e049 100644
--- a/svx/source/svdraw/svdpage.cxx
+++ b/svx/source/svdraw/svdpage.cxx
@@ -1413,7 +1413,7 @@ void SdrPage::TRG_SetMasterPage(SdrPage& rNew)
if(mpMasterPageDescriptor)
TRG_ClearMasterPage();
- mpMasterPageDescriptor = new sdr::MasterPageDescriptor(*this, rNew);
+ mpMasterPageDescriptor.reset(new sdr::MasterPageDescriptor(*this, rNew));
GetViewContact().ActionChanged();
}
@@ -1426,8 +1426,7 @@ void SdrPage::TRG_ClearMasterPage()
// the flushViewObjectContacts() will do needed invalidates by deleting the involved VOCs
mpMasterPageDescriptor->GetUsedPage().GetViewContact().flushViewObjectContacts();
- delete mpMasterPageDescriptor;
- mpMasterPageDescriptor = nullptr;
+ mpMasterPageDescriptor.reset();
}
}
More information about the Libreoffice-commits
mailing list