summaryrefslogtreecommitdiffstats
path: root/vcl/generic/glyphs
diff options
context:
space:
mode:
Diffstat (limited to 'vcl/generic/glyphs')
-rw-r--r--vcl/generic/glyphs/gcach_ftyp.cxx15
-rw-r--r--vcl/generic/glyphs/gcach_ftyp.hxx4
2 files changed, 12 insertions, 7 deletions
diff --git a/vcl/generic/glyphs/gcach_ftyp.cxx b/vcl/generic/glyphs/gcach_ftyp.cxx
index 9db574ee407b..fa93fc603738 100644
--- a/vcl/generic/glyphs/gcach_ftyp.cxx
+++ b/vcl/generic/glyphs/gcach_ftyp.cxx
@@ -242,7 +242,7 @@ FtFontInfo::FtFontInfo( const ImplDevFontAttributes& rDevFontAttributes,
FtFontInfo::~FtFontInfo()
{
if( mpFontCharMap )
- mpFontCharMap->DeReference();
+ mpFontCharMap = 0;
delete mpChar2Glyph;
delete mpGlyph2Char;
#if ENABLE_GRAPHITE
@@ -1265,13 +1265,13 @@ bool ServerFont::GetGlyphBitmap8( sal_GlyphId aGlyphId, RawBitmap& rRawBitmap )
// determine unicode ranges in font
-const ImplFontCharMap* ServerFont::GetImplFontCharMap( void ) const
+const ImplFontCharMapPtr ServerFont::GetImplFontCharMap( void ) const
{
- const ImplFontCharMap* pIFCMap = mpFontInfo->GetImplFontCharMap();
+ const ImplFontCharMapPtr pIFCMap = mpFontInfo->GetImplFontCharMap();
return pIFCMap;
}
-const ImplFontCharMap* FtFontInfo::GetImplFontCharMap( void )
+const ImplFontCharMapPtr FtFontInfo::GetImplFontCharMap( void )
{
// check if the charmap is already cached
if( mpFontCharMap )
@@ -1281,9 +1281,14 @@ const ImplFontCharMap* FtFontInfo::GetImplFontCharMap( void )
CmapResult aCmapResult;
bool bOK = GetFontCodeRanges( aCmapResult );
if( bOK )
- mpFontCharMap = new ImplFontCharMap( aCmapResult );
+ {
+ ImplFontCharMapPtr pFontCharMap( new ImplFontCharMap( aCmapResult ) );
+ mpFontCharMap = pFontCharMap;
+ }
else
+ {
mpFontCharMap = ImplFontCharMap::GetDefaultMap();
+ }
// mpFontCharMap on either branch now has a refcount of 1
return mpFontCharMap;
}
diff --git a/vcl/generic/glyphs/gcach_ftyp.hxx b/vcl/generic/glyphs/gcach_ftyp.hxx
index b43d47b39397..803ce072a955 100644
--- a/vcl/generic/glyphs/gcach_ftyp.hxx
+++ b/vcl/generic/glyphs/gcach_ftyp.hxx
@@ -84,7 +84,7 @@ public:
void CacheGlyphIndex( sal_UCS4 cChar, int nGI ) const;
bool GetFontCodeRanges( CmapResult& ) const;
- const ImplFontCharMap* GetImplFontCharMap( void );
+ const ImplFontCharMapPtr GetImplFontCharMap( void );
private:
FT_FaceRec_* maFaceFT;
@@ -99,7 +99,7 @@ private:
sal_IntPtr mnFontId;
ImplDevFontAttributes maDevFontAttributes;
- const ImplFontCharMap* mpFontCharMap;
+ ImplFontCharMapPtr mpFontCharMap;
// cache unicode->glyphid mapping because looking it up is expensive
// TODO: change to boost::unordered_multimap when a use case requires a m:n mapping