summaryrefslogtreecommitdiff
path: root/vcl/generic/fontmanager
diff options
context:
space:
mode:
authorChris Sherlock <chris.sherlock79@gmail.com>2014-10-04 21:55:58 +1000
committerChris Sherlock <chris.sherlock79@gmail.com>2014-10-06 00:13:38 +0000
commit9177329a425cf70b515d1f266132838894fe54c6 (patch)
treedd064e9b56019046faa0966d0147c19a7fa2ca3e /vcl/generic/fontmanager
parent36e1d19af8585bc2f36322ba32acbed46e58c4de (diff)
vcl: FontCharMap to use intrusive_ptr ImplFontCharMap
ImplFontCharMap was using it's own reference counting mechanism, however we can use intrusive_ptr more effectively. Added a unit test around FontCharMap. Change-Id: Ifab6ce002fd1df8feb7e017dea3012ff9ea7f18a Reviewed-on: https://gerrit.libreoffice.org/11804 Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com> Tested-by: Chris Sherlock <chris.sherlock79@gmail.com>
Diffstat (limited to 'vcl/generic/fontmanager')
-rw-r--r--vcl/generic/fontmanager/fontmanager.cxx6
1 files changed, 3 insertions, 3 deletions
diff --git a/vcl/generic/fontmanager/fontmanager.cxx b/vcl/generic/fontmanager/fontmanager.cxx
index 273707699350..05fc829d0e5e 100644
--- a/vcl/generic/fontmanager/fontmanager.cxx
+++ b/vcl/generic/fontmanager/fontmanager.cxx
@@ -2088,11 +2088,11 @@ void PrintFontManager::getGlyphWidths( fontID nFont,
CmapResult aCmapResult;
if( ParseCMAP( pCmapData, nCmapSize, aCmapResult ) )
{
- const ImplFontCharMap aCharMap( aCmapResult );
+ const ImplFontCharMapPtr pCharMap( new ImplFontCharMap(aCmapResult) );
for( sal_uInt32 cOld = 0;;)
{
// get next unicode covered by font
- const sal_uInt32 c = aCharMap.GetNextChar( cOld );
+ const sal_uInt32 c = pCharMap->GetNextChar( cOld );
if( c == cOld )
break;
cOld = c;
@@ -2101,7 +2101,7 @@ void PrintFontManager::getGlyphWidths( fontID nFont,
break;
#endif
// get the matching glyph index
- const sal_GlyphId aGlyphId = aCharMap.GetGlyphIndex( c );
+ const sal_GlyphId aGlyphId = pCharMap->GetGlyphIndex( c );
// update the requested map
rUnicodeEnc[ (sal_Unicode)c ] = aGlyphId;
}