diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-03-01 10:43:03 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-03-05 07:32:23 +0100 |
commit | c801400c476edf719a05a98f96c0559837023dbc (patch) | |
tree | 2b57dbdaa69abbdd015d004e65aca79f6fd6268e | |
parent | e21d9c89409159254966e9acb1ac98626549e301 (diff) |
loplugin:useuniqueptr in LwpFribSection
Change-Id: I128a2ef532a72b47cd2bedd1ee80f47d892cc527
Reviewed-on: https://gerrit.libreoffice.org/50727
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r-- | lotuswordpro/source/filter/lwpfribsection.cxx | 9 | ||||
-rw-r--r-- | lotuswordpro/source/filter/lwpfribsection.hxx | 2 |
2 files changed, 3 insertions, 8 deletions
diff --git a/lotuswordpro/source/filter/lwpfribsection.cxx b/lotuswordpro/source/filter/lwpfribsection.cxx index 5d0211adf7ff..153e5cf373ee 100644 --- a/lotuswordpro/source/filter/lwpfribsection.cxx +++ b/lotuswordpro/source/filter/lwpfribsection.cxx @@ -70,18 +70,13 @@ #include <lwpglobalmgr.hxx> LwpFribSection::LwpFribSection(LwpPara *pPara) - : LwpFrib(pPara),m_pMasterPage(nullptr) + : LwpFrib(pPara) { } LwpFribSection::~LwpFribSection() { - if(m_pMasterPage) - { - delete m_pMasterPage; - m_pMasterPage = nullptr; - } } /** @@ -111,7 +106,7 @@ void LwpFribSection::RegisterSectionStyle() LwpPageLayout* pLayout = GetPageLayout(); if(pLayout) { - m_pMasterPage = new LwpMasterPage(m_pPara, pLayout); + m_pMasterPage.reset( new LwpMasterPage(m_pPara, pLayout) ); m_pMasterPage->RegisterMasterPage(this); } } diff --git a/lotuswordpro/source/filter/lwpfribsection.hxx b/lotuswordpro/source/filter/lwpfribsection.hxx index ce4ac2531e88..58e8c91a3e5f 100644 --- a/lotuswordpro/source/filter/lwpfribsection.hxx +++ b/lotuswordpro/source/filter/lwpfribsection.hxx @@ -118,7 +118,7 @@ private: private: LwpObjectID m_Section; - LwpMasterPage* m_pMasterPage; + std::unique_ptr<LwpMasterPage> m_pMasterPage; }; #endif |