diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-02-27 17:09:21 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2017-02-27 17:09:31 +0000 |
commit | f641638b7724d129609814c6bb33cf4921caec69 (patch) | |
tree | 980737fb0d384692454e096420bd33e043bb40b7 /lotuswordpro | |
parent | 54cc53d3849a1a9158797b355b5e775305b34000 (diff) |
fix leak
Change-Id: I00438178582bd4c78bffeca18067abeb667b8367
Diffstat (limited to 'lotuswordpro')
-rw-r--r-- | lotuswordpro/source/filter/lwpparastyle.cxx | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lotuswordpro/source/filter/lwpparastyle.cxx b/lotuswordpro/source/filter/lwpparastyle.cxx index ac3aa0d973d6..49c899f4a928 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() |