lotuswordpro/source/filter/lwpparastyle.cxx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
New commits: commit f641638b7724d129609814c6bb33cf4921caec69 Author: Caolán McNamara <[email protected]> Date: Mon Feb 27 17:09:21 2017 +0000 fix leak Change-Id: I00438178582bd4c78bffeca18067abeb667b8367 diff --git a/lotuswordpro/source/filter/lwpparastyle.cxx b/lotuswordpro/source/filter/lwpparastyle.cxx index ac3aa0d..49c899f 100644 --- a/lotuswordpro/source/filter/lwpparastyle.cxx +++ b/lotuswordpro/source/filter/lwpparastyle.cxx @@ -666,23 +666,23 @@ void LwpParaStyle::RegisterStyle() if (!m_pFoundry) throw std::runtime_error("missing Foundry"); - XFParaStyle* pStyle = new XFParaStyle(); + std::unique_ptr<XFParaStyle> xStyle(new XFParaStyle()); //Set name OUString styleName = GetName().str(); - pStyle->SetStyleName(styleName); + xStyle->SetStyleName(styleName); //Create font LwpFontManager& rFontMgr = m_pFoundry->GetFontManger(); rtl::Reference<XFFont> pFont = rFontMgr.CreateFont(m_nFinalFontID); - pStyle->SetFont(pFont); + xStyle->SetFont(pFont); //Set other paragraph properties... - Apply(pStyle); + Apply(xStyle.get()); //Add style LwpStyleManager* pStyleMgr = m_pFoundry->GetStyleManager(); - pStyleMgr->AddStyle(GetObjectID(), pStyle); + pStyleMgr->AddStyle(GetObjectID(), xStyle.release()); } LwpAlignmentOverride* LwpParaStyle::GetAlignment()
_______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
