diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-06-22 13:40:49 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-06-25 09:15:39 +0200 |
commit | 879c455e49a28831fab1477d5ced65a69e5c2918 (patch) | |
tree | c012ffbfbb5699a24a1d95e66acbe02aff374f1e /lotuswordpro | |
parent | f2ab7b0ddbd324b3f98e4244bb56254bf030ac3d (diff) |
loplugin:useuniqueptr in XFStyleManager
Change-Id: I6fccaef0778ce02fc6d6daaa2fdb31af9ea1c19f
Reviewed-on: https://gerrit.libreoffice.org/56334
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'lotuswordpro')
-rw-r--r-- | lotuswordpro/inc/xfilter/xfstylemanager.hxx | 2 | ||||
-rw-r--r-- | lotuswordpro/source/filter/xfilter/xfstylemanager.cxx | 11 |
2 files changed, 4 insertions, 9 deletions
diff --git a/lotuswordpro/inc/xfilter/xfstylemanager.hxx b/lotuswordpro/inc/xfilter/xfstylemanager.hxx index f9e9d9411055..163ceafad865 100644 --- a/lotuswordpro/inc/xfilter/xfstylemanager.hxx +++ b/lotuswordpro/inc/xfilter/xfstylemanager.hxx @@ -133,7 +133,7 @@ private: XFStyleContainer s_aTableCellStyles; XFStyleContainer s_aTableRowStyles; XFStyleContainer s_aTableColStyles; - IXFStyle *s_pOutlineStyle; + std::unique_ptr<IXFStyle> s_pOutlineStyle; XFStyleContainer s_aRubyStyles; }; diff --git a/lotuswordpro/source/filter/xfilter/xfstylemanager.cxx b/lotuswordpro/source/filter/xfilter/xfstylemanager.cxx index 74a05f265a9b..84dcb725e969 100644 --- a/lotuswordpro/source/filter/xfilter/xfstylemanager.cxx +++ b/lotuswordpro/source/filter/xfilter/xfstylemanager.cxx @@ -80,11 +80,7 @@ XFStyleManager::~XFStyleManager() void XFStyleManager::Reset() { - if( s_pOutlineStyle ) - { - delete s_pOutlineStyle; - s_pOutlineStyle = nullptr; - } + s_pOutlineStyle.reset(); s_aStdTextStyles.Reset(); s_aStdParaStyles.Reset(); @@ -203,8 +199,7 @@ IXFStyleRet XFStyleManager::AddStyle(std::unique_ptr<IXFStyle> pStyle) } else if( pStyle->GetStyleFamily() == enumXFStyleOutline ) { - delete s_pOutlineStyle; - s_pOutlineStyle = pStyle.release(); + s_pOutlineStyle = std::move(pStyle); } else if( pStyle->GetStyleFamily() == enumXFStyleStrokeDash ) { @@ -265,7 +260,7 @@ IXFStyle* XFStyleManager::FindStyle(const OUString& name) if( pStyle ) return pStyle; if(s_pOutlineStyle && s_pOutlineStyle->GetStyleName() == name ) - return s_pOutlineStyle; + return s_pOutlineStyle.get(); pStyle = s_aStdStrokeDashStyles.FindStyle(name); if( pStyle ) return pStyle; |