Kaydet (Commit) c375cd09 authored tarafından Caolán McNamara's avatar Caolán McNamara

Resolves: fdo#35322 add a font only once under one of its names

Change-Id: I644596b71b8526501160c666e72162ae8190bfd3
üst 1574c76e
...@@ -1483,41 +1483,22 @@ ImplDevFontListData* ImplDevFontList::GetGlyphFallbackFont( FontSelectPattern& r ...@@ -1483,41 +1483,22 @@ ImplDevFontListData* ImplDevFontList::GetGlyphFallbackFont( FontSelectPattern& r
void ImplDevFontList::Add( PhysicalFontFace* pNewData ) void ImplDevFontList::Add( PhysicalFontFace* pNewData )
{ {
int nAliasQuality = pNewData->mnQuality - 100; String aSearchName = pNewData->maName;
String aMapNames = pNewData->maMapNames; GetEnglishSearchFontName( aSearchName );
pNewData->maMapNames = String();
bool bKeepNewData = false; DevFontList::const_iterator it = maDevFontList.find( aSearchName );
xub_StrLen nMapNameIndex = 0; ImplDevFontListData* pFoundData = NULL;
while( true ) if( it != maDevFontList.end() )
{ pFoundData = (*it).second;
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 );
// add (another) font alias if available if( !pFoundData )
// a font alias should never win against an original font with similar quality {
if( aMapNames.Len() <= nMapNameIndex ) pFoundData = new ImplDevFontListData( aSearchName );
break; maDevFontList[ aSearchName ] = pFoundData;
if( bKeepNewData ) // try to recycle obsoleted object
pNewData = pNewData->CreateAlias();
bKeepNewData = false;
pNewData->mnQuality = nAliasQuality;
pNewData->maName = GetNextFontToken( aMapNames, nMapNameIndex );
} }
bool bKeepNewData = pFoundData->AddFontFace( pNewData );
if( !bKeepNewData ) if( !bKeepNewData )
delete pNewData; delete pNewData;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment