diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-04-23 15:20:41 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-04-24 15:11:29 +0200 |
commit | 6ac3cf60a6b84f06c23f6e6208bc8994b7bcc7a4 (patch) | |
tree | 2f3a32e9160967c2ca805da20b56b15a5990517f /vcl | |
parent | baa91c67d6fb7f84f94795e6e3727cd0b5b23061 (diff) |
loplugin:useuniqueptr in FontCfgWrapper
Change-Id: I15a0626bcbeaea8e74455526bf485c8eb617e74e
Reviewed-on: https://gerrit.libreoffice.org/53359
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/unx/generic/fontmanager/fontconfig.cxx | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/vcl/unx/generic/fontmanager/fontconfig.cxx b/vcl/unx/generic/fontmanager/fontconfig.cxx index 639dc37591ae..3f9d39021175 100644 --- a/vcl/unx/generic/fontmanager/fontconfig.cxx +++ b/vcl/unx/generic/fontmanager/fontconfig.cxx @@ -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(); } /* |