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