[Libreoffice-commits] .: vcl/source

Caolán McNamara caolan at kemper.freedesktop.org
Sat Jul 14 05:55:21 PDT 2012


 vcl/source/gdi/outdev3.cxx |   43 ++++++++++++-------------------------------
 1 file changed, 12 insertions(+), 31 deletions(-)

New commits:
commit c375cd09d8c901b161176d0bb8f3cb6a2df1dc17
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sat Jul 14 11:53:34 2012 +0100

    Resolves: fdo#35322 add a font only once under one of its names
    
    Change-Id: I644596b71b8526501160c666e72162ae8190bfd3

diff --git a/vcl/source/gdi/outdev3.cxx b/vcl/source/gdi/outdev3.cxx
index e1bebd8..226ec08 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;
 }


More information about the Libreoffice-commits mailing list