Kaydet (Commit) 879c455e authored tarafından Noel Grandin's avatar Noel Grandin

loplugin:useuniqueptr in XFStyleManager

Change-Id: I6fccaef0778ce02fc6d6daaa2fdb31af9ea1c19f
Reviewed-on: https://gerrit.libreoffice.org/56334
Tested-by: Jenkins
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst f2ab7b0d
......@@ -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;
};
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment