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

Caolán McNamara caolanm at redhat.com
Tue Feb 28 20:54:27 UTC 2017


 lotuswordpro/source/filter/lwpfootnote.cxx |   16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

New commits:
commit 26ea6d50b3f0f82d4035b367811f8edcc49ee23e
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Feb 28 20:53:34 2017 +0000

    fix leak
    
    Change-Id: Ia073517977648a21d7adb5ee4d7bda51b1b7db18

diff --git a/lotuswordpro/source/filter/lwpfootnote.cxx b/lotuswordpro/source/filter/lwpfootnote.cxx
index b8ac3fd..dbf35db 100644
--- a/lotuswordpro/source/filter/lwpfootnote.cxx
+++ b/lotuswordpro/source/filter/lwpfootnote.cxx
@@ -103,28 +103,28 @@ void LwpFribFootnote::XFConvert(XFContentContainer* pCont)
     LwpFootnote* pFootnote = GetFootnote();
     if(pFootnote)
     {
-        XFContentContainer* pContent = nullptr;
+        rtl::Reference<XFContentContainer> xContent;
         if(pFootnote->GetType() == FN_FOOTNOTE)
         {
-            pContent = new XFFootNote();
+            xContent.set(new XFFootNote);
         }
         else
         {
-            pContent = new XFEndNote();
+            xContent.set(new XFEndNote);
         }
-        pFootnote->XFConvert(pContent);
-        if(m_ModFlag)
+        pFootnote->XFConvert(xContent.get());
+        if (m_ModFlag)
         {
             //set footnote number font style
-            XFTextSpan *pSpan = new XFTextSpan();
+            XFTextSpan *pSpan = new XFTextSpan;
             pSpan->SetStyleName(GetStyleName());
             //add the xffootnote into the content container
-            pSpan->Add(pContent);
+            pSpan->Add(xContent.get());
             pCont->Add(pSpan);
         }
         else
         {
-            pCont->Add(pContent);
+            pCont->Add(xContent.get());
         }
     }
 }


More information about the Libreoffice-commits mailing list