diff options
author | Chris Sherlock <chris.sherlock79@gmail.com> | 2014-10-06 18:16:16 +1100 |
---|---|---|
committer | Chris Sherlock <chris.sherlock79@gmail.com> | 2014-10-13 09:19:04 +0000 |
commit | f6d61562d41b8a49449d881da66a3d8fa519487f (patch) | |
tree | 15571322cf3bf8475fe2e1c5d1d0ae9fd38f7c1d /svtools | |
parent | bb1d4f8c9a275a20e8795ee36ca3259376746e4f (diff) |
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 'svtools')
-rw-r--r-- | svtools/source/misc/sampletext.cxx | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/svtools/source/misc/sampletext.cxx b/svtools/source/misc/sampletext.cxx index 14811a050a11..40f5d7d45121 100644 --- a/svtools/source/misc/sampletext.cxx +++ b/svtools/source/misc/sampletext.cxx @@ -164,8 +164,8 @@ OUString makeShortRepresentativeSymbolTextForSelectedFont(OutputDevice &rDevice) if (!bOpenSymbol) { - FontCharMap aFontCharMap; - bool bHasCharMap = rDevice.GetFontCharMap(aFontCharMap); + FontCharMapPtr pFontCharMap; + bool bHasCharMap = rDevice.GetFontCharMap(pFontCharMap); if( bHasCharMap ) { // use some sample characters available in the font @@ -175,7 +175,7 @@ OUString makeShortRepresentativeSymbolTextForSelectedFont(OutputDevice &rDevice) sal_uInt32 cNewChar = 0xFF00; const int nMaxCount = sizeof(aText)/sizeof(*aText) - 1; - int nSkip = aFontCharMap.GetCharCount() / nMaxCount; + int nSkip = pFontCharMap->GetCharCount() / nMaxCount; if( nSkip > 10 ) nSkip = 10; else if( nSkip <= 0 ) @@ -184,7 +184,7 @@ OUString makeShortRepresentativeSymbolTextForSelectedFont(OutputDevice &rDevice) { sal_uInt32 cOldChar = cNewChar; for( int j = nSkip; --j >= 0; ) - cNewChar = aFontCharMap.GetPrevChar( cNewChar ); + cNewChar = pFontCharMap->GetPrevChar( cNewChar ); if( cOldChar == cNewChar ) break; aText[ i ] = static_cast<sal_Unicode>(cNewChar); // TODO: support UCS4 samples @@ -193,6 +193,8 @@ OUString makeShortRepresentativeSymbolTextForSelectedFont(OutputDevice &rDevice) return OUString(aText); } + + pFontCharMap = 0; } static const sal_Unicode aImplSymbolFontText[] = { |