summaryrefslogtreecommitdiff
path: root/vcl/unx/generic
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2018-09-15 21:14:33 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-09-19 10:09:33 +0200
commitd469dca492e55798251c7f570bb730a38c32e893 (patch)
tree808c559f6dc8f7887dfd27eef318607e2df5f6ba /vcl/unx/generic
parent21614aadc2b7a7bb6d2e00a5a081d8d233e4384b (diff)
loplugin:useuniqueptr in GetTTSimpleGlyphMetrics
and only return the advance, we don't use the other field Change-Id: I956033dac97763caea2b27404fe9f099da809899 Reviewed-on: https://gerrit.libreoffice.org/60703 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl/unx/generic')
-rw-r--r--vcl/unx/generic/fontmanager/fontmanager.cxx12
1 files changed, 6 insertions, 6 deletions
diff --git a/vcl/unx/generic/fontmanager/fontmanager.cxx b/vcl/unx/generic/fontmanager/fontmanager.cxx
index 8b6ad13471a0..abd2c6c30232 100644
--- a/vcl/unx/generic/fontmanager/fontmanager.cxx
+++ b/vcl/unx/generic/fontmanager/fontmanager.cxx
@@ -1078,15 +1078,15 @@ bool PrintFontManager::createFontSubset(
rInfo.m_nCapHeight = yMax; // Well ...
// fill in glyph advance widths
- TTSimpleGlyphMetrics* pMetrics = GetTTSimpleGlyphMetrics( pTTFont,
+ std::unique_ptr<sal_uInt16[]> pMetrics = GetTTSimpleGlyphMetrics( pTTFont,
pGID,
nGlyphs,
false/*bVertical*/ );
if( pMetrics )
{
for( int i = 0; i < nGlyphs; i++ )
- pWidths[pOldIndex[i]] = pMetrics[i].adv;
- free( pMetrics );
+ pWidths[pOldIndex[i]] = pMetrics[i];
+ pMetrics.reset();
}
else
{
@@ -1123,15 +1123,15 @@ void PrintFontManager::getGlyphWidths( fontID nFont,
std::vector<sal_uInt16> aGlyphIds(nGlyphs);
for (int i = 0; i < nGlyphs; i++)
aGlyphIds[i] = sal_uInt16(i);
- TTSimpleGlyphMetrics* pMetrics = GetTTSimpleGlyphMetrics(pTTFont,
+ std::unique_ptr<sal_uInt16[]> pMetrics = GetTTSimpleGlyphMetrics(pTTFont,
&aGlyphIds[0],
nGlyphs,
bVertical);
if (pMetrics)
{
for (int i = 0; i< nGlyphs; i++)
- rWidths[i] = pMetrics[i].adv;
- free(pMetrics);
+ rWidths[i] = pMetrics[i];
+ pMetrics.reset();
rUnicodeEnc.clear();
}