summaryrefslogtreecommitdiffstats
path: root/vcl/generic
diff options
context:
space:
mode:
authorChris Sherlock <chris.sherlock79@gmail.com>2014-10-06 18:16:16 +1100
committerChris Sherlock <chris.sherlock79@gmail.com>2014-10-13 09:19:04 +0000
commitf6d61562d41b8a49449d881da66a3d8fa519487f (patch)
tree15571322cf3bf8475fe2e1c5d1d0ae9fd38f7c1d /vcl/generic
parentMake the image continuously resize back and forth in both cases (diff)
downloadcore-f6d61562d41b8a49449d881da66a3d8fa519487f.tar.gz
core-f6d61562d41b8a49449d881da66a3d8fa519487f.zip
vcl: Make ImplFontCharMap a pImpl and move functions to FontCharMap
To do this, I've made FontCharMap a friend class for ImplFontCharMap, and have moved the functions directly into FontCharMap. In this patch, I am attempting to stop the direct use of ImplFontCharMap by anything other than FontCharMap. However, FontCharMap itself requires a refcounter, so we will use FontCharMapPtr to access the font character map. Change-Id: I509b990a8cbd911c5cc1572c7d24fc5348ca06d9 Reviewed-on: https://gerrit.libreoffice.org/11823 Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com> Tested-by: Chris Sherlock <chris.sherlock79@gmail.com>
Diffstat (limited to 'vcl/generic')
-rw-r--r--vcl/generic/fontmanager/fontmanager.cxx4
-rw-r--r--vcl/generic/glyphs/gcach_ftyp.cxx13
-rw-r--r--vcl/generic/glyphs/gcach_ftyp.hxx4
-rw-r--r--vcl/generic/print/genpspgraphics.cxx6
4 files changed, 15 insertions, 12 deletions
diff --git a/vcl/generic/fontmanager/fontmanager.cxx b/vcl/generic/fontmanager/fontmanager.cxx
index 746d8395b51b..53448c61a752 100644
--- a/vcl/generic/fontmanager/fontmanager.cxx
+++ b/vcl/generic/fontmanager/fontmanager.cxx
@@ -2088,7 +2088,7 @@ void PrintFontManager::getGlyphWidths( fontID nFont,
CmapResult aCmapResult;
if( ParseCMAP( pCmapData, nCmapSize, aCmapResult ) )
{
- const ImplFontCharMapPtr pCharMap( new ImplFontCharMap(aCmapResult) );
+ FontCharMapPtr pCharMap( new FontCharMap(aCmapResult) );
for( sal_uInt32 cOld = 0;;)
{
// get next unicode covered by font
@@ -2105,6 +2105,8 @@ void PrintFontManager::getGlyphWidths( fontID nFont,
// update the requested map
rUnicodeEnc[ (sal_Unicode)c ] = aGlyphId;
}
+
+ pCharMap = 0;
}
}
}
diff --git a/vcl/generic/glyphs/gcach_ftyp.cxx b/vcl/generic/glyphs/gcach_ftyp.cxx
index 4a8ddd014ded..9e12d5a2be05 100644
--- a/vcl/generic/glyphs/gcach_ftyp.cxx
+++ b/vcl/generic/glyphs/gcach_ftyp.cxx
@@ -1266,13 +1266,13 @@ bool ServerFont::GetGlyphBitmap8( sal_GlyphId aGlyphId, RawBitmap& rRawBitmap )
// determine unicode ranges in font
-const ImplFontCharMapPtr ServerFont::GetImplFontCharMap( void ) const
+const FontCharMapPtr ServerFont::GetFontCharMap() const
{
- const ImplFontCharMapPtr pIFCMap = mpFontInfo->GetImplFontCharMap();
- return pIFCMap;
+ const FontCharMapPtr pFCMap = mpFontInfo->GetFontCharMap();
+ return pFCMap;
}
-const ImplFontCharMapPtr FtFontInfo::GetImplFontCharMap( void )
+const FontCharMapPtr FtFontInfo::GetFontCharMap()
{
// check if the charmap is already cached
if( mpFontCharMap )
@@ -1283,12 +1283,13 @@ const ImplFontCharMapPtr FtFontInfo::GetImplFontCharMap( void )
bool bOK = GetFontCodeRanges( aCmapResult );
if( bOK )
{
- ImplFontCharMapPtr pFontCharMap( new ImplFontCharMap( aCmapResult ) );
+ FontCharMapPtr pFontCharMap( new FontCharMap ( aCmapResult ) );
mpFontCharMap = pFontCharMap;
}
else
{
- mpFontCharMap = ImplFontCharMap::GetDefaultMap();
+ FontCharMapPtr pFontCharMap( new FontCharMap() );
+ mpFontCharMap = pFontCharMap;
}
// 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 803ce072a955..21cd6538bcca 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 ImplFontCharMapPtr GetImplFontCharMap( void );
+ const FontCharMapPtr GetFontCharMap();
private:
FT_FaceRec_* maFaceFT;
@@ -99,7 +99,7 @@ private:
sal_IntPtr mnFontId;
ImplDevFontAttributes maDevFontAttributes;
- ImplFontCharMapPtr mpFontCharMap;
+ FontCharMapPtr 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
diff --git a/vcl/generic/print/genpspgraphics.cxx b/vcl/generic/print/genpspgraphics.cxx
index 759519b3cefa..644e4fdb99a3 100644
--- a/vcl/generic/print/genpspgraphics.cxx
+++ b/vcl/generic/print/genpspgraphics.cxx
@@ -777,13 +777,13 @@ void GenPspGraphics::DrawServerFontLayout( const ServerFontLayout& rLayout )
DrawPrinterLayout( rLayout, *m_pPrinterGfx, true );
}
-const ImplFontCharMapPtr GenPspGraphics::GetImplFontCharMap() const
+const FontCharMapPtr GenPspGraphics::GetFontCharMap() const
{
if( !m_pServerFont[0] )
return NULL;
- const ImplFontCharMapPtr pIFCMap = m_pServerFont[0]->GetImplFontCharMap();
- return pIFCMap;
+ const FontCharMapPtr pFCMap = m_pServerFont[0]->GetFontCharMap();
+ return pFCMap;
}
bool GenPspGraphics::GetFontCapabilities(vcl::FontCapabilities &rFontCapabilities) const