[Libreoffice-commits] core.git: lotuswordpro/source

Caolán McNamara caolanm at redhat.com
Sun Jan 7 20:08:08 UTC 2018


 lotuswordpro/source/filter/lwptoc.cxx |   18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

New commits:
commit 19f0a4cb75e0430502d003fa00ff47801912af03
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sun Jan 7 15:06:59 2018 +0000

    ofz#5012 Direct-leak
    
    Change-Id: Ic4d5d9086c64559a2c8c06f20a8b6f461b84d440
    Reviewed-on: https://gerrit.libreoffice.org/47535
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

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);
         }


More information about the Libreoffice-commits mailing list