diff options
author | Noel <noel.grandin@collabora.co.uk> | 2021-03-05 10:47:16 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-03-07 13:24:51 +0100 |
commit | 1d2773807f6d2deb1181ef4b14fbdd49ca1d5c14 (patch) | |
tree | 788ef3ef220549c9785bcf1f5b35becc176300d4 /basctl | |
parent | e4e80ed313882f9ea1b309054e5aa3e839586516 (diff) |
ref-count SdrPage
which simplifies ownership handling, particularly with regard to
undo/redo
Change-Id: Ie8f300ebfdae6db3c06f78a87e35a07497d6b825
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111991
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'basctl')
-rw-r--r-- | basctl/source/dlged/dlgedmod.cxx | 5 | ||||
-rw-r--r-- | basctl/source/dlged/dlgedpage.cxx | 6 | ||||
-rw-r--r-- | basctl/source/inc/dlgedmod.hxx | 2 | ||||
-rw-r--r-- | basctl/source/inc/dlgedpage.hxx | 2 |
4 files changed, 9 insertions, 6 deletions
diff --git a/basctl/source/dlged/dlgedmod.cxx b/basctl/source/dlged/dlgedmod.cxx index 291b5b9136f5..3bc5453ad66f 100644 --- a/basctl/source/dlged/dlgedmod.cxx +++ b/basctl/source/dlged/dlgedmod.cxx @@ -29,7 +29,10 @@ DlgEdModel::DlgEdModel() DlgEdModel::~DlgEdModel() {} -SdrPage* DlgEdModel::AllocPage(bool bMasterPage) { return new DlgEdPage(*this, bMasterPage); } +rtl::Reference<SdrPage> DlgEdModel::AllocPage(bool bMasterPage) +{ + return new DlgEdPage(*this, bMasterPage); +} } // namespace basctl diff --git a/basctl/source/dlged/dlgedpage.cxx b/basctl/source/dlged/dlgedpage.cxx index d422f757868c..760f88527609 100644 --- a/basctl/source/dlged/dlgedpage.cxx +++ b/basctl/source/dlged/dlgedpage.cxx @@ -38,13 +38,13 @@ DlgEdPage::~DlgEdPage() ClearSdrObjList(); } -SdrPage* DlgEdPage::CloneSdrPage(SdrModel& rTargetModel) const +rtl::Reference<SdrPage> DlgEdPage::CloneSdrPage(SdrModel& rTargetModel) const { DlgEdModel& rDlgEdModel(static_cast< DlgEdModel& >(rTargetModel)); - DlgEdPage* pClonedDlgEdPage( + rtl::Reference<DlgEdPage> pClonedDlgEdPage = new DlgEdPage( rDlgEdModel, - IsMasterPage())); + IsMasterPage()); pClonedDlgEdPage->SdrPage::lateInit(*this); return pClonedDlgEdPage; } diff --git a/basctl/source/inc/dlgedmod.hxx b/basctl/source/inc/dlgedmod.hxx index 2960135e0d3d..24a97905b1d3 100644 --- a/basctl/source/inc/dlgedmod.hxx +++ b/basctl/source/inc/dlgedmod.hxx @@ -37,7 +37,7 @@ public: DlgEdModel(); virtual ~DlgEdModel() override; - virtual SdrPage* AllocPage(bool bMasterPage) override; + virtual rtl::Reference<SdrPage> AllocPage(bool bMasterPage) override; }; } // namespace basctl diff --git a/basctl/source/inc/dlgedpage.hxx b/basctl/source/inc/dlgedpage.hxx index 7b8d48faa331..91efc12edd70 100644 --- a/basctl/source/inc/dlgedpage.hxx +++ b/basctl/source/inc/dlgedpage.hxx @@ -39,7 +39,7 @@ public: explicit DlgEdPage(DlgEdModel& rModel, bool bMasterPage = false); virtual ~DlgEdPage() override; - virtual SdrPage* CloneSdrPage(SdrModel& rTargetModel) const override; + virtual rtl::Reference<SdrPage> CloneSdrPage(SdrModel& rTargetModel) const override; void SetDlgEdForm(DlgEdForm* pForm) { pDlgEdForm = pForm; } DlgEdForm* GetDlgEdForm() const { return pDlgEdForm; } |