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>
This commit is contained in:
@@ -133,7 +133,7 @@ private:
|
|||||||
XFStyleContainer s_aTableCellStyles;
|
XFStyleContainer s_aTableCellStyles;
|
||||||
XFStyleContainer s_aTableRowStyles;
|
XFStyleContainer s_aTableRowStyles;
|
||||||
XFStyleContainer s_aTableColStyles;
|
XFStyleContainer s_aTableColStyles;
|
||||||
IXFStyle *s_pOutlineStyle;
|
std::unique_ptr<IXFStyle> s_pOutlineStyle;
|
||||||
XFStyleContainer s_aRubyStyles;
|
XFStyleContainer s_aRubyStyles;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -80,11 +80,7 @@ XFStyleManager::~XFStyleManager()
|
|||||||
|
|
||||||
void XFStyleManager::Reset()
|
void XFStyleManager::Reset()
|
||||||
{
|
{
|
||||||
if( s_pOutlineStyle )
|
s_pOutlineStyle.reset();
|
||||||
{
|
|
||||||
delete s_pOutlineStyle;
|
|
||||||
s_pOutlineStyle = nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
s_aStdTextStyles.Reset();
|
s_aStdTextStyles.Reset();
|
||||||
s_aStdParaStyles.Reset();
|
s_aStdParaStyles.Reset();
|
||||||
@@ -203,8 +199,7 @@ IXFStyleRet XFStyleManager::AddStyle(std::unique_ptr<IXFStyle> pStyle)
|
|||||||
}
|
}
|
||||||
else if( pStyle->GetStyleFamily() == enumXFStyleOutline )
|
else if( pStyle->GetStyleFamily() == enumXFStyleOutline )
|
||||||
{
|
{
|
||||||
delete s_pOutlineStyle;
|
s_pOutlineStyle = std::move(pStyle);
|
||||||
s_pOutlineStyle = pStyle.release();
|
|
||||||
}
|
}
|
||||||
else if( pStyle->GetStyleFamily() == enumXFStyleStrokeDash )
|
else if( pStyle->GetStyleFamily() == enumXFStyleStrokeDash )
|
||||||
{
|
{
|
||||||
@@ -265,7 +260,7 @@ IXFStyle* XFStyleManager::FindStyle(const OUString& name)
|
|||||||
if( pStyle )
|
if( pStyle )
|
||||||
return pStyle;
|
return pStyle;
|
||||||
if(s_pOutlineStyle && s_pOutlineStyle->GetStyleName() == name )
|
if(s_pOutlineStyle && s_pOutlineStyle->GetStyleName() == name )
|
||||||
return s_pOutlineStyle;
|
return s_pOutlineStyle.get();
|
||||||
pStyle = s_aStdStrokeDashStyles.FindStyle(name);
|
pStyle = s_aStdStrokeDashStyles.FindStyle(name);
|
||||||
if( pStyle )
|
if( pStyle )
|
||||||
return pStyle;
|
return pStyle;
|
||||||
|
Reference in New Issue
Block a user