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: ...@@ -88,7 +88,7 @@ public:
private: private:
void cacheLocalizedFontNames(const FcChar8 *origfontname, const FcChar8 *bestfontname, const std::vector< lang_and_element > &lang_and_elements); 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() FontCfgWrapper::FontCfgWrapper()
...@@ -354,7 +354,7 @@ FcResult FontCfgWrapper::LocalizedElementFromPattern(FcPattern const * pPattern, ...@@ -354,7 +354,7 @@ FcResult FontCfgWrapper::LocalizedElementFromPattern(FcPattern const * pPattern,
{ {
rtl_Locale* pLoc = nullptr; rtl_Locale* pLoc = nullptr;
osl_getProcessLocale(&pLoc); osl_getProcessLocale(&pLoc);
m_pLanguageTag = new LanguageTag(*pLoc); m_pLanguageTag.reset( new LanguageTag(*pLoc) );
} }
*element = bestname(lang_and_elements, *m_pLanguageTag); *element = bestname(lang_and_elements, *m_pLanguageTag);
...@@ -376,8 +376,7 @@ void FontCfgWrapper::clear() ...@@ -376,8 +376,7 @@ void FontCfgWrapper::clear()
FcFontSetDestroy( m_pOutlineSet ); FcFontSetDestroy( m_pOutlineSet );
m_pOutlineSet = nullptr; m_pOutlineSet = nullptr;
} }
delete m_pLanguageTag; m_pLanguageTag.reset();
m_pLanguageTag = nullptr;
} }
/* /*
......
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