[Libreoffice-commits] core.git: lotuswordpro/inc lotuswordpro/source
Noel Grandin
noel.grandin at collabora.co.uk
Mon Jun 25 07:16:01 UTC 2018
lotuswordpro/inc/xfilter/xfstylemanager.hxx | 2 +-
lotuswordpro/source/filter/xfilter/xfstylemanager.cxx | 11 +++--------
2 files changed, 4 insertions(+), 9 deletions(-)
New commits:
commit 879c455e49a28831fab1477d5ced65a69e5c2918
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date: Fri Jun 22 13:40:49 2018 +0200
loplugin:useuniqueptr in XFStyleManager
Change-Id: I6fccaef0778ce02fc6d6daaa2fdb31af9ea1c19f
Reviewed-on: https://gerrit.libreoffice.org/56334
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
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;
More information about the Libreoffice-commits
mailing list