[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - vcl/source

Matúš Kukan matus.kukan at collabora.com
Sat May 31 03:54:16 PDT 2014


 vcl/source/gdi/outdev3.cxx |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

New commits:
commit 27c29269d569cc7ec175da17f012a04123a9ac7c
Author: Matúš Kukan <matus.kukan at collabora.com>
Date:   Tue May 27 16:37:30 2014 +0200

    Related bnc#822625: Cache FontEntry with the original FontSelectPattern.
    
    Otherwise we do not hit cache directly, only after expensive call to
    ImplFindByFont.
    
    (cherry picked from commits a6b00d16eb27a5e7e31c721671001a909ecef960
    and 16a62079018aea0e72636bdb00576487b4e830b9)
    
    Change-Id: If15b368feeba94c8fff8ee7cbe049fc4a2069768
    Reviewed-on: https://gerrit.libreoffice.org/9520
    Reviewed-by: Andras Timar <andras.timar at collabora.com>
    Tested-by: Andras Timar <andras.timar at collabora.com>

diff --git a/vcl/source/gdi/outdev3.cxx b/vcl/source/gdi/outdev3.cxx
index 537f8aa..a36fc85 100644
--- a/vcl/source/gdi/outdev3.cxx
+++ b/vcl/source/gdi/outdev3.cxx
@@ -2214,6 +2214,7 @@ ImplFontEntry* ImplFontCache::GetFontEntry( ImplDevFontList* pFontList,
 ImplFontEntry* ImplFontCache::GetFontEntry( ImplDevFontList* pFontList,
     FontSelectPattern& aFontSelData, ImplDirectFontSubstitution* pDevSpecific )
 {
+    FontSelectPattern aFontSelDataOrig(aFontSelData);
     // check if a directly matching logical font instance is already cached,
     // the most recently used font usually has a hit rate of >50%
     ImplFontEntry *pEntry = NULL;
@@ -2300,8 +2301,9 @@ ImplFontEntry* ImplFontCache::GetFontEntry( ImplDevFontList* pFontList,
         }
 #endif
 
-        // add the new entry to the cache
-        maFontInstanceList[ aFontSelData ] = pEntry;
+        // Add the new entry to the cache with the original FontSelectPattern,
+        // so that we can find it next time as a direct cache hit.
+        maFontInstanceList[ aFontSelDataOrig ] = pEntry;
     }
 
     mpFirstEntry = pEntry;


More information about the Libreoffice-commits mailing list