summaryrefslogtreecommitdiff
path: root/lotuswordpro
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-01-07 15:06:59 +0000
committerCaolán McNamara <caolanm@redhat.com>2018-01-07 21:07:34 +0100
commit19f0a4cb75e0430502d003fa00ff47801912af03 (patch)
tree2f6da0e8daf7a83759ef903762e9c529f07f4285 /lotuswordpro
parent9dad387df78f4043ca0c718f27ed06006fa7128a (diff)
ofz#5012 Direct-leak
Change-Id: Ic4d5d9086c64559a2c8c06f20a8b6f461b84d440 Reviewed-on: https://gerrit.libreoffice.org/47535 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'lotuswordpro')
-rw-r--r--lotuswordpro/source/filter/lwptoc.cxx18
1 files changed, 9 insertions, 9 deletions
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<XFFrame> 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<sal_uInt16>(nStart));
+ m_pFrame->Parse(xXFFrame.get(), static_cast<sal_uInt16>(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<LwpVirtualLayout> 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);
}