diff options
Diffstat (limited to 'vcl/quartz')
-rw-r--r-- | vcl/quartz/salgdi.cxx | 6 | ||||
-rw-r--r-- | vcl/quartz/salgdicommon.cxx | 12 |
2 files changed, 9 insertions, 9 deletions
diff --git a/vcl/quartz/salgdi.cxx b/vcl/quartz/salgdi.cxx index db595a5aa37b..43ca506220c9 100644 --- a/vcl/quartz/salgdi.cxx +++ b/vcl/quartz/salgdi.cxx @@ -756,15 +756,15 @@ void AquaSalGraphics::GetGlyphWidths( const PhysicalFontFace* pFontData, bool bV aGlyphIds[i] = static_cast<sal_uInt16>(i); } - const TTSimpleGlyphMetrics* pGlyphMetrics = ::GetTTSimpleGlyphMetrics( pSftFont, &aGlyphIds[0], + std::unique_ptr<sal_uInt16[]> pGlyphMetrics = ::GetTTSimpleGlyphMetrics( pSftFont, &aGlyphIds[0], nGlyphCount, bVertical ); if( pGlyphMetrics ) { for( int i = 0; i < nGlyphCount; ++i ) { - rGlyphWidths[i] = pGlyphMetrics[i].adv; + rGlyphWidths[i] = pGlyphMetrics[i]; } - free( const_cast<TTSimpleGlyphMetrics *>(pGlyphMetrics) ); + pGlyphMetrics.reset(); } rtl::Reference<CoreTextFontFace> rCTFontData(new CoreTextFontFace(*pFontData, pFontData->GetFontId())); diff --git a/vcl/quartz/salgdicommon.cxx b/vcl/quartz/salgdicommon.cxx index 59d836506b52..2d952244847e 100644 --- a/vcl/quartz/salgdicommon.cxx +++ b/vcl/quartz/salgdicommon.cxx @@ -302,21 +302,21 @@ bool AquaSalGraphics::CreateFontSubset( const OUString& rToFile, // fill the pGlyphWidths array // while making sure that the NotDef glyph is at index==0 - TTSimpleGlyphMetrics* pGlyphMetrics = ::GetTTSimpleGlyphMetrics( pSftFont, aShortIDs, + std::unique_ptr<sal_uInt16[]> pGlyphMetrics = ::GetTTSimpleGlyphMetrics( pSftFont, aShortIDs, nGlyphCount, bVertical ); if( !pGlyphMetrics ) { return false; } - sal_uInt16 nNotDefAdv = pGlyphMetrics[0].adv; - pGlyphMetrics[0].adv = pGlyphMetrics[nNotDef].adv; - pGlyphMetrics[nNotDef].adv = nNotDefAdv; + sal_uInt16 nNotDefAdv = pGlyphMetrics[0]; + pGlyphMetrics[0] = pGlyphMetrics[nNotDef]; + pGlyphMetrics[nNotDef] = nNotDefAdv; for( int i = 0; i < nOrigCount; ++i ) { - pGlyphWidths[i] = pGlyphMetrics[i].adv; + pGlyphWidths[i] = pGlyphMetrics[i]; } - free( pGlyphMetrics ); + pGlyphMetrics.reset(); // write subset into destination file nRC = ::CreateTTFromTTGlyphs( pSftFont, aToFile.getStr(), aShortIDs, |