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

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


 lotuswordpro/source/filter/lwppagelayout.cxx |   15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

New commits:
commit 328d26a17b9ea3243ed0ae96384acc08d7fea0c0
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Feb 28 10:19:11 2017 +0000

    fix leak
    
    Change-Id: I88e652fa2eab8738d0e1a235cf1a3f9066bfc230

diff --git a/lotuswordpro/source/filter/lwppagelayout.cxx b/lotuswordpro/source/filter/lwppagelayout.cxx
index 4fa01d2..bdb99af 100644
--- a/lotuswordpro/source/filter/lwppagelayout.cxx
+++ b/lotuswordpro/source/filter/lwppagelayout.cxx
@@ -754,23 +754,22 @@ void LwpHeaderLayout::Read()
 
 void LwpHeaderLayout::RegisterStyle(XFPageMaster* pm1)
 {
-    XFHeaderStyle* pHeaderStyle = new XFHeaderStyle();
+    std::unique_ptr<XFHeaderStyle> xHeaderStyle(new XFHeaderStyle());
 
     //Modify page top margin
     //page top marging: from top of header to the top edge
     double top = GetMarginsValue(MARGIN_TOP);
     pm1->SetMargins(-1, -1, top, -1);
 
-    ParseMargins(pHeaderStyle);
-    ParseBorder(pHeaderStyle);
-    ParseShadow(pHeaderStyle);
-//  ParseBackColor(pHeaderStyle);
-    ParseBackGround(pHeaderStyle);
+    ParseMargins(xHeaderStyle.get());
+    ParseBorder(xHeaderStyle.get());
+    ParseShadow(xHeaderStyle.get());
+    ParseBackGround(xHeaderStyle.get());
 
-    ParseWaterMark(pHeaderStyle);
+    ParseWaterMark(xHeaderStyle.get());
     //End by
 
-    pm1->SetHeaderStyle(pHeaderStyle);
+    pm1->SetHeaderStyle(xHeaderStyle.release());
 }
 
 void LwpHeaderLayout::ParseMargins(XFHeaderStyle* ph1)


More information about the Libreoffice-commits mailing list