summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2019-03-27 11:11:54 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-03-28 07:40:46 +0100
commit471fdea812f1ce9be349474bc3817bbb75186bba (patch)
treee61a242073818f828cba9adcf3871a0eb3b67708
parentd337731d4f7017d51fab08f0edbac1effc9baf90 (diff)
return unique_ptr from SdrPage::CreateObjectSpecificViewContact
Change-Id: I3297128efd44f4df86886d6f0349420d6ce18571 Reviewed-on: https://gerrit.libreoffice.org/69855 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--include/svx/svdpage.hxx2
-rw-r--r--svx/source/svdraw/svdpage.cxx10
2 files changed, 6 insertions, 6 deletions
diff --git a/include/svx/svdpage.hxx b/include/svx/svdpage.hxx
index d78652d1f262..24747bc823a9 100644
--- a/include/svx/svdpage.hxx
+++ b/include/svx/svdpage.hxx
@@ -392,7 +392,7 @@ public:
SdrModel& getSdrModelFromSdrPage() const { return mrSdrModelFromSdrPage; }
protected:
- sdr::contact::ViewContact* CreateObjectSpecificViewContact();
+ std::unique_ptr<sdr::contact::ViewContact> CreateObjectSpecificViewContact();
public:
const sdr::contact::ViewContact& GetViewContact() const;
sdr::contact::ViewContact& GetViewContact();
diff --git a/svx/source/svdraw/svdpage.cxx b/svx/source/svdraw/svdpage.cxx
index 6e527f4ead8f..bcdf677120c6 100644
--- a/svx/source/svdraw/svdpage.cxx
+++ b/svx/source/svdraw/svdpage.cxx
@@ -981,16 +981,16 @@ void SdrPage::RemovePageUser(sdr::PageUser& rOldUser)
// DrawContact section
-sdr::contact::ViewContact* SdrPage::CreateObjectSpecificViewContact()
+std::unique_ptr<sdr::contact::ViewContact> SdrPage::CreateObjectSpecificViewContact()
{
- return new sdr::contact::ViewContactOfSdrPage(*this);
+ return std::make_unique<sdr::contact::ViewContactOfSdrPage>(*this);
}
const sdr::contact::ViewContact& SdrPage::GetViewContact() const
{
if (!mpViewContact)
- const_cast<SdrPage*>(this)->mpViewContact.reset(
- const_cast<SdrPage*>(this)->CreateObjectSpecificViewContact());
+ const_cast<SdrPage*>(this)->mpViewContact =
+ const_cast<SdrPage*>(this)->CreateObjectSpecificViewContact();
return *mpViewContact;
}
@@ -998,7 +998,7 @@ const sdr::contact::ViewContact& SdrPage::GetViewContact() const
sdr::contact::ViewContact& SdrPage::GetViewContact()
{
if (!mpViewContact)
- mpViewContact.reset(CreateObjectSpecificViewContact());
+ mpViewContact = CreateObjectSpecificViewContact();
return *mpViewContact;
}