From 19f0a4cb75e0430502d003fa00ff47801912af03 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Sun, 7 Jan 2018 15:06:59 +0000 Subject: ofz#5012 Direct-leak MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ic4d5d9086c64559a2c8c06f20a8b6f461b84d440 Reviewed-on: https://gerrit.libreoffice.org/47535 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- lotuswordpro/source/filter/lwptoc.cxx | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'lotuswordpro') diff --git a/lotuswordpro/source/filter/lwptoc.cxx b/lotuswordpro/source/filter/lwptoc.cxx index 4e94e7aac4b2..38a41e580f9c 100644 --- a/lotuswordpro/source/filter/lwptoc.cxx +++ b/lotuswordpro/source/filter/lwptoc.cxx @@ -261,25 +261,25 @@ void LwpTocSuperLayout::XFConvert(XFContentContainer* pCont) */ void LwpTocSuperLayout::XFConvertFrame(XFContentContainer* pCont, sal_Int32 nStart, sal_Int32 nEnd, bool bAll) { - if(m_pFrame) + if (m_pFrame) { - XFFrame* pXFFrame = nullptr; + rtl::Reference xXFFrame; if(nEnd < nStart) { - pXFFrame = new XFFrame(); + xXFFrame.set(new XFFrame); } else { - pXFFrame = new XFFloatFrame(nStart, nEnd, bAll); + xXFFrame.set(new XFFloatFrame(nStart, nEnd, bAll)); } - m_pFrame->Parse(pXFFrame, static_cast(nStart)); + m_pFrame->Parse(xXFFrame.get(), static_cast(nStart)); //parse table, and add table to frame or TOC LwpTableLayout * pTableLayout = GetTableLayout(); if (pTableLayout) { - XFContentContainer * pTableContainer = pXFFrame; + XFContentContainer* pTableContainer = xXFFrame.get(); // if *this is a TOCSuperTableLayout and it's located in a cell // add the frame to upper level and add TOCSuperTableLayout into the frame rtl::Reference xContainer(GetContainerLayout()); @@ -288,13 +288,13 @@ void LwpTocSuperLayout::XFConvertFrame(XFContentContainer* pCont, sal_Int32 nSt if (xContainer->IsCell()) { pTableContainer = pCont; // TOC contain table directly - pXFFrame->Add(pCont); - m_pCont->Add(pXFFrame); + xXFFrame->Add(pCont); + m_pCont->Add(xXFFrame.get()); } else { //add frame to the container - pCont->Add(pXFFrame); + pCont->Add(xXFFrame.get()); } pTableLayout->XFConvert(pTableContainer); } -- cgit