diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-02-28 11:44:17 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2017-02-28 11:44:17 +0000 |
commit | 36398bb8ba85dea1d16fe86cd78b0da8380fe7ad (patch) | |
tree | 70deb5e4b074dba4cf1f786812bd8046d413360f | |
parent | e7c960e233e4a7742a8359f6f4b3ae4a62e069ea (diff) |
std::unique_ptr -> rtl::Reference for loplugin:refcounting
Change-Id: I83cccff1f4fb172e1b6aa5c1cfda93de2e4be525
-rw-r--r-- | lotuswordpro/source/filter/lwppagelayout.cxx | 8 | ||||
-rw-r--r-- | lotuswordpro/source/filter/xfilter/xfmasterpage.cxx | 29 | ||||
-rw-r--r-- | lotuswordpro/source/filter/xfilter/xfmasterpage.hxx | 13 |
3 files changed, 16 insertions, 34 deletions
diff --git a/lotuswordpro/source/filter/lwppagelayout.cxx b/lotuswordpro/source/filter/lwppagelayout.cxx index 4b674214591e..35d6119bb175 100644 --- a/lotuswordpro/source/filter/lwppagelayout.cxx +++ b/lotuswordpro/source/filter/lwppagelayout.cxx @@ -872,7 +872,7 @@ void LwpHeaderLayout::ParseWaterMark(XFHeaderStyle * pHeaderStyle) void LwpHeaderLayout::RegisterStyle(XFMasterPage* mp1) { - std::unique_ptr<XFHeader> xHeader(new XFHeader()); + rtl::Reference<XFHeader> xHeader(new XFHeader()); rtl::Reference<LwpObject> pStory = m_Content.obj(); if(pStory.is()) { @@ -892,7 +892,7 @@ void LwpHeaderLayout::RegisterStyle(XFMasterPage* mp1) pChangeMgr->SetHeadFootFribMap(false); } - mp1->SetHeader(xHeader.release()); + mp1->SetHeader(xHeader); } LwpFooterLayout::LwpFooterLayout( LwpObjectHeader &objHdr, LwpSvStream* pStrm ) @@ -1023,7 +1023,7 @@ void LwpFooterLayout::ParseBackColor(XFFooterStyle* pFooterStyle) void LwpFooterLayout::RegisterStyle(XFMasterPage* mp1) { - std::unique_ptr<XFFooter> xFooter(new XFFooter()); + rtl::Reference<XFFooter> xFooter(new XFFooter()); rtl::Reference<LwpObject> pStory = m_Content.obj(VO_STORY); //Call the RegisterStyle first to register the styles in footer paras, and then XFConvert() if(pStory.is()) @@ -1043,7 +1043,7 @@ void LwpFooterLayout::RegisterStyle(XFMasterPage* mp1) pChangeMgr->SetHeadFootFribMap(false); } - mp1->SetFooter(xFooter.release()); + mp1->SetFooter(xFooter); } void LwpFooterLayout::ParseWaterMark(XFFooterStyle * pFooterStyle) diff --git a/lotuswordpro/source/filter/xfilter/xfmasterpage.cxx b/lotuswordpro/source/filter/xfilter/xfmasterpage.cxx index 5fe16aa49556..96b4b6057a03 100644 --- a/lotuswordpro/source/filter/xfilter/xfmasterpage.cxx +++ b/lotuswordpro/source/filter/xfilter/xfmasterpage.cxx @@ -63,28 +63,15 @@ #include "xffooter.hxx" #include "xfheader.hxx" #include "../lwpglobalmgr.hxx" -XFMasterPage::XFMasterPage() -{ - m_pHeader = nullptr; - m_pFooter = nullptr; -} - -XFMasterPage::~XFMasterPage() -{ - delete m_pHeader; - delete m_pFooter; -} -void XFMasterPage::SetHeader(XFHeader *pHeader) +void XFMasterPage::SetHeader(rtl::Reference<XFHeader>& rHeader) { - delete m_pHeader; - m_pHeader = pHeader; + m_xHeader = rHeader; } -void XFMasterPage::SetFooter(XFFooter *pFooter) +void XFMasterPage::SetFooter(rtl::Reference<XFFooter>& rFooter) { - delete m_pFooter; - m_pFooter = pFooter; + m_xFooter = rFooter; } enumXFStyle XFMasterPage::GetStyleFamily() @@ -105,10 +92,10 @@ void XFMasterPage::ToXml(IXFStream *pStrm) pAttrList->AddAttribute( "style:name", m_strStyleName ); pAttrList->AddAttribute( "style:page-master-name", m_strPageMaster ); pStrm->StartElement( "style:master-page" ); - if( m_pHeader ) - m_pHeader->ToXml(pStrm); - if( m_pFooter ) - m_pFooter->ToXml(pStrm); + if (m_xHeader) + m_xHeader->ToXml(pStrm); + if (m_xFooter) + m_xFooter->ToXml(pStrm); pStrm->EndElement( "style:master-page" ); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lotuswordpro/source/filter/xfilter/xfmasterpage.hxx b/lotuswordpro/source/filter/xfilter/xfmasterpage.hxx index acd3c00af3c0..367e37ca1163 100644 --- a/lotuswordpro/source/filter/xfilter/xfmasterpage.hxx +++ b/lotuswordpro/source/filter/xfilter/xfmasterpage.hxx @@ -68,16 +68,11 @@ class XFHeader; class XFMasterPage : public XFStyle { public: - XFMasterPage(); - - virtual ~XFMasterPage() override; - -public: void SetPageMaster(const OUString& pm); - void SetHeader(XFHeader *pHeader); + void SetHeader(rtl::Reference<XFHeader>& rHeader); - void SetFooter(XFFooter *pFooter); + void SetFooter(rtl::Reference<XFFooter>& rFooter); virtual enumXFStyle GetStyleFamily() override; @@ -85,8 +80,8 @@ public: private: OUString m_strPageMaster; - XFHeader *m_pHeader; - XFFooter *m_pFooter; + rtl::Reference<XFHeader> m_xHeader; + rtl::Reference<XFFooter> m_xFooter; }; #endif |