summaryrefslogtreecommitdiff
path: root/vcl/unx/generic
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-08-13 14:35:52 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-08-15 08:40:23 +0200
commit9467f10de690c622a210120e1963b2d755875a6b (patch)
tree597596ea05f61d503ff4ab5b10b3e26cd3b273be /vcl/unx/generic
parent40ab9800d3d19eee59571092a9872c8fe9af4e38 (diff)
loplugin:useuniqueptr in FreetypeManager
Change-Id: Idf8f843f2740bc20e6b0877b62dbfc778e31acd8 Reviewed-on: https://gerrit.libreoffice.org/59018 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl/unx/generic')
-rw-r--r--vcl/unx/generic/glyphs/freetype_glyphcache.cxx11
1 files changed, 3 insertions, 8 deletions
diff --git a/vcl/unx/generic/glyphs/freetype_glyphcache.cxx b/vcl/unx/generic/glyphs/freetype_glyphcache.cxx
index 32d6f9c8d10a..c747da4dae18 100644
--- a/vcl/unx/generic/glyphs/freetype_glyphcache.cxx
+++ b/vcl/unx/generic/glyphs/freetype_glyphcache.cxx
@@ -308,7 +308,7 @@ void FreetypeManager::AddFontFile( const OString& rNormalizedName,
FreetypeFontInfo* pFontInfo = new FreetypeFontInfo( rDevFontAttr,
rNormalizedName, nFaceNum, nFontId);
- maFontList[ nFontId ] = pFontInfo;
+ maFontList[ nFontId ].reset(pFontInfo);
if( mnMaxFontId < nFontId )
mnMaxFontId = nFontId;
}
@@ -317,18 +317,13 @@ void FreetypeManager::AnnounceFonts( PhysicalFontCollection* pToAdd ) const
{
for (auto const& font : maFontList)
{
- FreetypeFontInfo* pFreetypeFontInfo = font.second;
+ FreetypeFontInfo* pFreetypeFontInfo = font.second.get();
pFreetypeFontInfo->AnnounceFont( pToAdd );
}
}
void FreetypeManager::ClearFontList( )
{
- for (auto const& font : maFontList)
- {
- FreetypeFontInfo* pFreetypeFontInfo = font.second;
- delete pFreetypeFontInfo;
- }
maFontList.clear();
}
@@ -344,7 +339,7 @@ FreetypeFont* FreetypeManager::CreateFont( const FontSelectPattern& rFSD )
sal_IntPtr nFontId = pFontFace->GetFontId();
FontList::iterator it = maFontList.find(nFontId);
- FreetypeFontInfo* pFontInfo = it != maFontList.end() ? it->second : nullptr;
+ FreetypeFontInfo* pFontInfo = it != maFontList.end() ? it->second.get() : nullptr;
if (!pFontInfo)
return nullptr;