Kaydet (Commit) 6ac3cf60 authored tarafından Noel Grandin's avatar Noel Grandin

loplugin:useuniqueptr in FontCfgWrapper

Change-Id: I15a0626bcbeaea8e74455526bf485c8eb617e74e
Reviewed-on: https://gerrit.libreoffice.org/53359Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst baa91c67
......@@ -88,7 +88,7 @@ public:
private:
void cacheLocalizedFontNames(const FcChar8 *origfontname, const FcChar8 *bestfontname, const std::vector< lang_and_element > &lang_and_elements);
LanguageTag* m_pLanguageTag;
std::unique_ptr<LanguageTag> m_pLanguageTag;
};
FontCfgWrapper::FontCfgWrapper()
......@@ -354,7 +354,7 @@ FcResult FontCfgWrapper::LocalizedElementFromPattern(FcPattern const * pPattern,
{
rtl_Locale* pLoc = nullptr;
osl_getProcessLocale(&pLoc);
m_pLanguageTag = new LanguageTag(*pLoc);
m_pLanguageTag.reset( new LanguageTag(*pLoc) );
}
*element = bestname(lang_and_elements, *m_pLanguageTag);
......@@ -376,8 +376,7 @@ void FontCfgWrapper::clear()
FcFontSetDestroy( m_pOutlineSet );
m_pOutlineSet = nullptr;
}
delete m_pLanguageTag;
m_pLanguageTag = nullptr;
m_pLanguageTag.reset();
}
/*
......
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