Kaydet (Commit) c801400c authored tarafından Noel Grandin's avatar Noel Grandin

loplugin:useuniqueptr in LwpFribSection

Change-Id: I128a2ef532a72b47cd2bedd1ee80f47d892cc527
Reviewed-on: https://gerrit.libreoffice.org/50727Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst e21d9c89
...@@ -70,18 +70,13 @@ ...@@ -70,18 +70,13 @@
#include <lwpglobalmgr.hxx> #include <lwpglobalmgr.hxx>
LwpFribSection::LwpFribSection(LwpPara *pPara) LwpFribSection::LwpFribSection(LwpPara *pPara)
: LwpFrib(pPara),m_pMasterPage(nullptr) : LwpFrib(pPara)
{ {
} }
LwpFribSection::~LwpFribSection() LwpFribSection::~LwpFribSection()
{ {
if(m_pMasterPage)
{
delete m_pMasterPage;
m_pMasterPage = nullptr;
}
} }
/** /**
...@@ -111,7 +106,7 @@ void LwpFribSection::RegisterSectionStyle() ...@@ -111,7 +106,7 @@ void LwpFribSection::RegisterSectionStyle()
LwpPageLayout* pLayout = GetPageLayout(); LwpPageLayout* pLayout = GetPageLayout();
if(pLayout) if(pLayout)
{ {
m_pMasterPage = new LwpMasterPage(m_pPara, pLayout); m_pMasterPage.reset( new LwpMasterPage(m_pPara, pLayout) );
m_pMasterPage->RegisterMasterPage(this); m_pMasterPage->RegisterMasterPage(this);
} }
} }
......
...@@ -118,7 +118,7 @@ private: ...@@ -118,7 +118,7 @@ private:
private: private:
LwpObjectID m_Section; LwpObjectID m_Section;
LwpMasterPage* m_pMasterPage; std::unique_ptr<LwpMasterPage> m_pMasterPage;
}; };
#endif #endif
......
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