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

Use std::unique_ptr for the SdrPageProperties member of SdrPage.

Change-Id: I37d95bd91c5bee1028eceda24e84b17162d0d2b1
Reviewed-on: https://gerrit.libreoffice.org/20844Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarKohei Yoshida <libreoffice@kohei.us>
üst c6b11cf6
......@@ -414,12 +414,12 @@ public:
private:
std::unique_ptr<SdrLayerAdmin> mpLayerAdmin;
SdrPageProperties* mpSdrPageProperties;
std::unique_ptr<SdrPageProperties> mpSdrPageProperties;
css::uno::Reference< css::uno::XInterface > mxUnoPage;
public:
SdrPageProperties& getSdrPageProperties() { return *mpSdrPageProperties; }
const SdrPageProperties& getSdrPageProperties() const { return *mpSdrPageProperties; }
SdrPageProperties& getSdrPageProperties();
const SdrPageProperties& getSdrPageProperties() const;
const SdrPageProperties* getCorrectSdrPageProperties() const;
protected:
......
......@@ -1219,7 +1219,7 @@ SdrPage::SdrPage(SdrModel& rNewModel, bool bMasterPage)
aPrefVisiLayers.SetAll();
eListKind = (bMasterPage) ? SDROBJLIST_MASTERPAGE : SDROBJLIST_DRAWPAGE;
mpSdrPageProperties = new SdrPageProperties(*this);
mpSdrPageProperties.reset(new SdrPageProperties(*this));
}
SdrPage::SdrPage(const SdrPage& rSrcPage)
......@@ -1278,12 +1278,7 @@ SdrPage::~SdrPage()
TRG_ClearMasterPage();
mpViewContact.reset();
{
delete mpSdrPageProperties;
mpSdrPageProperties = nullptr;
}
mpSdrPageProperties.reset();
}
void SdrPage::lateInit(const SdrPage& rSrcPage, SdrModel* const pNewModel)
......@@ -1325,7 +1320,7 @@ void SdrPage::lateInit(const SdrPage& rSrcPage, SdrModel* const pNewModel)
mbObjectsNotPersistent = rSrcPage.mbObjectsNotPersistent;
{
mpSdrPageProperties = new SdrPageProperties(*this);
mpSdrPageProperties.reset(new SdrPageProperties(*this));
if(!IsMasterPage())
{
......@@ -1524,7 +1519,7 @@ void SdrPage::SetModel(SdrModel* pNewModel)
// create new SdrPageProperties with new model (due to SfxItemSet there)
// and copy ItemSet and StyleSheet
SdrPageProperties *pNew = new SdrPageProperties(*this);
std::unique_ptr<SdrPageProperties> pNew(new SdrPageProperties(*this));
if(!IsMasterPage())
{
......@@ -1533,8 +1528,7 @@ void SdrPage::SetModel(SdrModel* pNewModel)
pNew->SetStyleSheet(getSdrPageProperties().GetStyleSheet());
delete mpSdrPageProperties;
mpSdrPageProperties = pNew;
mpSdrPageProperties = std::move(pNew);
}
// update listeners at possible API wrapper object
......@@ -1792,7 +1786,15 @@ void SdrPage::ActionChanged()
}
}
// sdr::Comment interface
SdrPageProperties& SdrPage::getSdrPageProperties()
{
return *mpSdrPageProperties;
}
const SdrPageProperties& SdrPage::getSdrPageProperties() const
{
return *mpSdrPageProperties;
}
const SdrPageProperties* SdrPage::getCorrectSdrPageProperties() const
{
......
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