summaryrefslogtreecommitdiff
path: root/vcl/inc/unx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-07-16 08:42:50 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-07-17 08:39:00 +0200
commitecd0ce5529ad6a577260bacaeff58a8bdf9c379f (patch)
treee4c1d861393074cc423172f47798f3c802404edf /vcl/inc/unx
parent60c08199f215ff7db335a692cbbcb72d1ac582d1 (diff)
loplugin:useuniqueptr in PrintFontManager
Change-Id: I539e167b0b9d3523d50cbebc13227867c5f05bd5 Reviewed-on: https://gerrit.libreoffice.org/57515 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl/inc/unx')
-rw-r--r--vcl/inc/unx/fontmanager.hxx7
1 files changed, 3 insertions, 4 deletions
diff --git a/vcl/inc/unx/fontmanager.hxx b/vcl/inc/unx/fontmanager.hxx
index 8b2c70c25000..fcaf801018c4 100644
--- a/vcl/inc/unx/fontmanager.hxx
+++ b/vcl/inc/unx/fontmanager.hxx
@@ -136,7 +136,7 @@ class VCL_PLUGIN_PUBLIC PrintFontManager
};
fontID m_nNextFontID;
- std::unordered_map< fontID, PrintFont* > m_aFonts;
+ std::unordered_map< fontID, std::unique_ptr<PrintFont> > m_aFonts;
// for speeding up findFontFileID
std::unordered_map< OString, std::set< fontID > >
m_aFontFileToFontID;
@@ -163,9 +163,8 @@ class VCL_PLUGIN_PUBLIC PrintFontManager
PrintFont* getFont( fontID nID ) const
{
- std::unordered_map< fontID, PrintFont* >::const_iterator it;
- it = m_aFonts.find( nID );
- return it == m_aFonts.end() ? nullptr : it->second;
+ auto it = m_aFonts.find( nID );
+ return it == m_aFonts.end() ? nullptr : it->second.get();
}
static void fillPrintFontInfo(PrintFont* pFont, FastPrintFontInfo& rInfo);
void fillPrintFontInfo( PrintFont* pFont, PrintFontInfo& rInfo ) const;