diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-02-28 13:14:51 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2017-02-28 13:14:51 +0000 |
commit | def48d5027bc51504acbfc3f190cb93e3870e83c (patch) | |
tree | 034a97886d189c1b2ef75a43ff01b32e34e4ed70 /lotuswordpro/source | |
parent | 73051d46a62d588db75a73cd392f7e39b3f5bf5b (diff) |
fix leak
Change-Id: Icce163a695ce5467d943019919de1bb604dd130b
Diffstat (limited to 'lotuswordpro/source')
-rw-r--r-- | lotuswordpro/source/filter/lwptablelayout.cxx | 19 |
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 |