summaryrefslogtreecommitdiff
path: root/vcl/source/gdi
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2012-07-14 11:53:34 +0100
committerCaolán McNamara <caolanm@redhat.com>2012-07-14 11:53:34 +0100
commitc375cd09d8c901b161176d0bb8f3cb6a2df1dc17 (patch)
treef2417c2f74cb222e7f0325ca792e34583c3a2f0d /vcl/source/gdi
parent1574c76ec20d1da479ed7e9c85a6cefacc132dfe (diff)
Resolves: fdo#35322 add a font only once under one of its names
Change-Id: I644596b71b8526501160c666e72162ae8190bfd3
Diffstat (limited to 'vcl/source/gdi')
-rw-r--r--vcl/source/gdi/outdev3.cxx43
1 files changed, 12 insertions, 31 deletions
diff --git a/vcl/source/gdi/outdev3.cxx b/vcl/source/gdi/outdev3.cxx
index e1bebd8385a5..226ec08b98f9 100644
--- a/vcl/source/gdi/outdev3.cxx
+++ b/vcl/source/gdi/outdev3.cxx
@@ -1483,41 +1483,22 @@ ImplDevFontListData* ImplDevFontList::GetGlyphFallbackFont( FontSelectPattern& r
void ImplDevFontList::Add( PhysicalFontFace* pNewData )
{
- int nAliasQuality = pNewData->mnQuality - 100;
- String aMapNames = pNewData->maMapNames;
- pNewData->maMapNames = String();
+ String aSearchName = pNewData->maName;
+ GetEnglishSearchFontName( aSearchName );
- bool bKeepNewData = false;
- xub_StrLen nMapNameIndex = 0;
- while( true )
- {
- String aSearchName = pNewData->maName;
- GetEnglishSearchFontName( aSearchName );
-
- DevFontList::const_iterator it = maDevFontList.find( aSearchName );
- ImplDevFontListData* pFoundData = NULL;
- if( it != maDevFontList.end() )
- pFoundData = (*it).second;
-
- if( !pFoundData )
- {
- pFoundData = new ImplDevFontListData( aSearchName );
- maDevFontList[ aSearchName ] = pFoundData;
- }
-
- bKeepNewData = pFoundData->AddFontFace( pNewData );
+ DevFontList::const_iterator it = maDevFontList.find( aSearchName );
+ ImplDevFontListData* pFoundData = NULL;
+ if( it != maDevFontList.end() )
+ pFoundData = (*it).second;
- // add (another) font alias if available
- // a font alias should never win against an original font with similar quality
- if( aMapNames.Len() <= nMapNameIndex )
- break;
- if( bKeepNewData ) // try to recycle obsoleted object
- pNewData = pNewData->CreateAlias();
- bKeepNewData = false;
- pNewData->mnQuality = nAliasQuality;
- pNewData->maName = GetNextFontToken( aMapNames, nMapNameIndex );
+ if( !pFoundData )
+ {
+ pFoundData = new ImplDevFontListData( aSearchName );
+ maDevFontList[ aSearchName ] = pFoundData;
}
+ bool bKeepNewData = pFoundData->AddFontFace( pNewData );
+
if( !bKeepNewData )
delete pNewData;
}