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

Caolán McNamara caolanm at redhat.com
Tue Feb 28 13:16:28 UTC 2017


 lotuswordpro/source/filter/lwptablelayout.cxx |   19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)

New commits:
commit def48d5027bc51504acbfc3f190cb93e3870e83c
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Feb 28 13:14:51 2017 +0000

    fix leak
    
    Change-Id: Icce163a695ce5467d943019919de1bb604dd130b

diff --git a/lotuswordpro/source/filter/lwptablelayout.cxx b/lotuswordpro/source/filter/lwptablelayout.cxx
index c9acba7..f690daf 100644
--- a/lotuswordpro/source/filter/lwptablelayout.cxx
+++ b/lotuswordpro/source/filter/lwptablelayout.cxx
@@ -712,7 +712,7 @@ void LwpTableLayout::RegisterStyle()
     RegisterColumns();
 
     // register style of whole table
-    XFTableStyle * pTableStyle = new XFTableStyle();
+    std::unique_ptr<XFTableStyle> xTableStyle(new XFTableStyle);
 
     sal_uInt8 nType = pSuper->GetRelativeType();
     // If the table is not "with paragraph above" placement, create an frame style
@@ -721,21 +721,20 @@ void LwpTableLayout::RegisterStyle()
         && (!pSuper->GetContainerLayout().is() || !pSuper->GetContainerLayout()->IsCell()) )
     {
         //with para above
-//      pSuper->ApplyBackColor(pTableStyle);
-        pSuper->ApplyBackGround(pTableStyle);
-        pSuper->ApplyWatermark(pTableStyle);
-        pSuper->ApplyShadow(pTableStyle);
-        pSuper->ApplyAlignment(pTableStyle);
-        pTableStyle->SetWidth(pSuper->GetTableWidth());
+        pSuper->ApplyBackGround(xTableStyle.get());
+        pSuper->ApplyWatermark(xTableStyle.get());
+        pSuper->ApplyShadow(xTableStyle.get());
+        pSuper->ApplyAlignment(xTableStyle.get());
+        xTableStyle->SetWidth(pSuper->GetTableWidth());
     }
     else
     {
         pSuper->RegisterFrameStyle();
-        pTableStyle->SetAlign(enumXFAlignCenter);
-        pTableStyle->SetWidth(pSuper->GetTableWidth());
+        xTableStyle->SetAlign(enumXFAlignCenter);
+        xTableStyle->SetWidth(pSuper->GetTableWidth());
     }
     XFStyleManager* pXFStyleManager = LwpGlobalMgr::GetInstance()->GetXFStyleManager();
-    m_StyleName = pXFStyleManager->AddStyle(pTableStyle).m_pStyle->GetStyleName();
+    m_StyleName = pXFStyleManager->AddStyle(xTableStyle.release()).m_pStyle->GetStyleName();
 
     //convert to OO table now and register row style
     // traverse


More information about the Libreoffice-commits mailing list