summaryrefslogtreecommitdiffstats
path: root/lotuswordpro
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-02-28 13:14:51 +0000
committerCaolán McNamara <caolanm@redhat.com>2017-02-28 13:14:51 +0000
commitdef48d5027bc51504acbfc3f190cb93e3870e83c (patch)
tree034a97886d189c1b2ef75a43ff01b32e34e4ed70 /lotuswordpro
parentofz: detect failure earlier (diff)
downloadcore-def48d5027bc51504acbfc3f190cb93e3870e83c.tar.gz
core-def48d5027bc51504acbfc3f190cb93e3870e83c.zip
fix leak
Change-Id: Icce163a695ce5467d943019919de1bb604dd130b
Diffstat (limited to 'lotuswordpro')
-rw-r--r--lotuswordpro/source/filter/lwptablelayout.cxx19
1 files changed, 9 insertions, 10 deletions
diff --git a/lotuswordpro/source/filter/lwptablelayout.cxx b/lotuswordpro/source/filter/lwptablelayout.cxx
index c9acba7407e3..f690daf296a4 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