Kaydet (Commit) a103c345 authored tarafından Kohei Yoshida's avatar Kohei Yoshida Kaydeden (comit) Kohei Yoshida

Use std::unique_ptr for SdrLayerAdmin data member.

Change-Id: Ib49f52c94ae96b8bddec6718585d5d7d6e3d148d
Reviewed-on: https://gerrit.libreoffice.org/20806Reviewed-by: 's avatarKohei Yoshida <libreoffice@kohei.us>
Tested-by: 's avatarKohei Yoshida <libreoffice@kohei.us>
üst dc89367a
......@@ -28,7 +28,6 @@
#include <tools/contnr.hxx>
#include <cppuhelper/weakref.hxx>
#include <svx/svdtypes.hxx>
#include <svx/svdlayer.hxx>
#include <svx/sdrpageuser.hxx>
#include <svx/sdr/contact/viewobjectcontactredirector.hxx>
#include <svx/sdrmasterpagedescriptor.hxx>
......@@ -417,9 +416,8 @@ friend class reportdesign::OSection;
sal_Int32 nBordRgt; // Seitenrand rechts
sal_Int32 nBordLwr; // Seitenrand unten
protected:
SdrLayerAdmin* pLayerAdmin;
private:
std::unique_ptr<SdrLayerAdmin> mpLayerAdmin;
SdrPageProperties* mpSdrPageProperties;
css::uno::Reference< css::uno::XInterface > mxUnoPage;
......@@ -506,8 +504,8 @@ protected:
public:
/// changing the layers does not set the modified-flag!
const SdrLayerAdmin& GetLayerAdmin() const { return *pLayerAdmin; }
SdrLayerAdmin& GetLayerAdmin() { return *pLayerAdmin; }
const SdrLayerAdmin& GetLayerAdmin() const;
SdrLayerAdmin& GetLayerAdmin();
virtual OUString GetLayoutName() const;
......
......@@ -37,6 +37,7 @@
#include <svx/xtable.hxx>
#include <svx/svdoutl.hxx>
#include <svx/svditer.hxx>
#include <svx/svdlayer.hxx>
#include <svx/svdocapt.hxx>
#include <svx/svdocirc.hxx>
#include <svx/svdoedge.hxx>
......
......@@ -84,6 +84,7 @@
#include <svx/xlnclit.hxx>
#include <svx/svditer.hxx>
#include <svx/svdogrp.hxx>
#include <svx/svdlayer.hxx>
#include <tools/shl.hxx>
#include <editeng/numitem.hxx>
#include <editeng/editeng.hxx>
......
......@@ -47,6 +47,7 @@
#include <editeng/flditem.hxx>
#include <svx/sdr/contact/displayinfo.hxx>
#include <svx/svditer.hxx>
#include <svx/svdlayer.hxx>
#include <com/sun/star/xml/dom/XNode.hpp>
#include <com/sun/star/xml/dom/XNodeList.hpp>
#include <com/sun/star/xml/dom/XNamedNodeMap.hpp>
......
......@@ -1203,7 +1203,7 @@ SdrPage::SdrPage(SdrModel& rNewModel, bool bMasterPage)
nBordUpp(0L),
nBordRgt(0L),
nBordLwr(0L),
pLayerAdmin(new SdrLayerAdmin(&rNewModel.GetLayerAdmin())),
mpLayerAdmin(new SdrLayerAdmin(&rNewModel.GetLayerAdmin())),
mpSdrPageProperties(nullptr),
mpMasterPageDescriptor(nullptr),
nPageNum(0L),
......@@ -1228,7 +1228,7 @@ SdrPage::SdrPage(const SdrPage& rSrcPage)
nBordUpp(rSrcPage.nBordUpp),
nBordRgt(rSrcPage.nBordRgt),
nBordLwr(rSrcPage.nBordLwr),
pLayerAdmin(new SdrLayerAdmin(rSrcPage.pModel->GetLayerAdmin())),
mpLayerAdmin(new SdrLayerAdmin(rSrcPage.pModel->GetLayerAdmin())),
mpSdrPageProperties(nullptr),
mpMasterPageDescriptor(nullptr),
nPageNum(rSrcPage.nPageNum),
......@@ -1269,7 +1269,7 @@ SdrPage::~SdrPage()
// when they get called from PageInDestruction().
maPageUsers.clear();
delete pLayerAdmin;
mpLayerAdmin.reset();
TRG_ClearMasterPage();
......@@ -1506,11 +1506,11 @@ sal_Int32 SdrPage::GetLwrBorder() const
void SdrPage::impl_setModelForLayerAdmin(SdrModel* const pNewModel)
{
if (pNewModel!=nullptr) {
pLayerAdmin->SetParent(&pNewModel->GetLayerAdmin());
mpLayerAdmin->SetParent(&pNewModel->GetLayerAdmin());
} else {
pLayerAdmin->SetParent(nullptr);
mpLayerAdmin->SetParent(nullptr);
}
pLayerAdmin->SetModel(pNewModel);
mpLayerAdmin->SetModel(pNewModel);
}
void SdrPage::SetModel(SdrModel* pNewModel)
......@@ -1661,6 +1661,16 @@ const SdrPageGridFrameList* SdrPage::GetGridFrameList(const SdrPageView* /*pPV*/
return nullptr;
}
const SdrLayerAdmin& SdrPage::GetLayerAdmin() const
{
return *mpLayerAdmin;
}
SdrLayerAdmin& SdrPage::GetLayerAdmin()
{
return *mpLayerAdmin;
}
OUString SdrPage::GetLayoutName() const
{
return OUString();
......
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