diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-02-28 12:01:29 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2017-02-28 12:01:29 +0000 |
commit | 06206252f43c388e781f7bf1665604da108f14c8 (patch) | |
tree | d79acbe9d53bef9167969cbb64b73d1522dd79f6 /lotuswordpro/source | |
parent | std::unique_ptr -> rtl::Reference for loplugin:refcounting (diff) | |
download | core-06206252f43c388e781f7bf1665604da108f14c8.tar.gz core-06206252f43c388e781f7bf1665604da108f14c8.zip |
fix leak
Change-Id: I724c6e50392d70acd847c733e09a959c08c8c790
Diffstat (limited to 'lotuswordpro/source')
-rw-r--r-- | lotuswordpro/source/filter/lwpstory.cxx | 19 | ||||
-rw-r--r-- | lotuswordpro/source/filter/lwpstory.hxx | 2 |
2 files changed, 8 insertions, 13 deletions
diff --git a/lotuswordpro/source/filter/lwpstory.cxx b/lotuswordpro/source/filter/lwpstory.cxx index 30383482adba..6a700be49753 100644 --- a/lotuswordpro/source/filter/lwpstory.cxx +++ b/lotuswordpro/source/filter/lwpstory.cxx @@ -75,7 +75,6 @@ LwpStory::LwpStory(LwpObjectHeader &objHdr, LwpSvStream* pStrm) , m_pTabLayout(nullptr) , m_bDropcap(false) , m_pHyperlinkMgr(new LwpHyperlinkMgr) - , m_pXFContainer(nullptr) { } @@ -141,11 +140,10 @@ void LwpStory::RegisterStyle() void LwpStory::Parse(IXFStream* pOutputStream) { - m_pXFContainer = new XFContentContainer; - XFConvert(m_pXFContainer); - m_pXFContainer->ToXml(pOutputStream); - delete m_pXFContainer; - m_pXFContainer = nullptr; + m_xXFContainer.set(new XFContentContainer); + XFConvert(m_xXFContainer.get()); + m_xXFContainer->ToXml(pOutputStream); + m_xXFContainer.clear(); } /************************************************************************** @@ -392,16 +390,13 @@ void LwpStory::XFConvertFrameInHeaderFooter(XFContentContainer* pCont) void LwpStory::AddXFContent(XFContent* pContent) { - if(m_pXFContainer) - m_pXFContainer->Add(pContent); + if (m_xXFContainer) + m_xXFContainer->Add(pContent); } XFContentContainer* LwpStory::GetXFContent() { - if(m_pXFContainer) - return m_pXFContainer; - else - return nullptr; + return m_xXFContainer.get(); } LwpPara* LwpStory::GetLastParaOfPreviousStory() diff --git a/lotuswordpro/source/filter/lwpstory.hxx b/lotuswordpro/source/filter/lwpstory.hxx index 39a5b22ee486..f4c421bea964 100644 --- a/lotuswordpro/source/filter/lwpstory.hxx +++ b/lotuswordpro/source/filter/lwpstory.hxx @@ -90,7 +90,7 @@ private: std::unique_ptr<LwpHyperlinkMgr> m_pHyperlinkMgr; OUString m_CurrSectionName; - XFContentContainer* m_pXFContainer; + rtl::Reference<XFContentContainer> m_xXFContainer; protected: void Read() override; |