[Libreoffice-commits] core.git: vcl/inc vcl/source

Matúš Kukan matus.kukan at collabora.com
Wed May 28 06:30:18 PDT 2014


 vcl/inc/outdev.h           |    2 +-
 vcl/source/outdev/font.cxx |   10 +++++-----
 2 files changed, 6 insertions(+), 6 deletions(-)

New commits:
commit 16a62079018aea0e72636bdb00576487b4e830b9
Author: Matúš Kukan <matus.kukan at collabora.com>
Date:   Wed May 28 15:13:47 2014 +0200

    Oops, this reference can't be const.
    
    It's used in ImplFontCache::GetGlyphFallbackFont.
    
    This is fix for commit a6b00d16eb27a5e7e31c721671001a909ecef960,
    which caused huge performance regression for document in fdo#59882,
    fortunately immediately detected by loperf.
    
    Change-Id: I475742b5249f106d34c4f6c43b1e39e9bb7b897a

diff --git a/vcl/inc/outdev.h b/vcl/inc/outdev.h
index e468ae2..dcde57c 100644
--- a/vcl/inc/outdev.h
+++ b/vcl/inc/outdev.h
@@ -149,7 +149,7 @@ public:
 
     ImplFontEntry*      GetFontEntry( PhysicalFontCollection*,
                              const Font&, const Size& rPixelSize, float fExactHeight);
-    ImplFontEntry*      GetFontEntry( PhysicalFontCollection*, const FontSelectPattern& );
+    ImplFontEntry*      GetFontEntry( PhysicalFontCollection*, FontSelectPattern& );
     ImplFontEntry*      GetGlyphFallbackFont( PhysicalFontCollection*, FontSelectPattern&,
                             int nFallbackLevel, OUString& rMissingCodes );
     void                Release( ImplFontEntry* );
diff --git a/vcl/source/outdev/font.cxx b/vcl/source/outdev/font.cxx
index d8b77db..6de4765 100644
--- a/vcl/source/outdev/font.cxx
+++ b/vcl/source/outdev/font.cxx
@@ -1227,23 +1227,23 @@ ImplFontEntry* ImplFontCache::GetFontEntry( PhysicalFontCollection* pFontList,
 }
 
 ImplFontEntry* ImplFontCache::GetFontEntry( PhysicalFontCollection* pFontList,
-    const FontSelectPattern& rFontSelData )
+    FontSelectPattern& aFontSelData )
 {
+    const 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;
     PhysicalFontFamily* pFontFamily = NULL;
     IFSD_Equal aIFSD_Equal;
-    if( mpFirstEntry && aIFSD_Equal( rFontSelData, mpFirstEntry->maFontSelData ) )
+    if( mpFirstEntry && aIFSD_Equal( aFontSelData, mpFirstEntry->maFontSelData ) )
         pEntry = mpFirstEntry;
     else
     {
-        FontInstanceList::iterator it = maFontInstanceList.find( rFontSelData );
+        FontInstanceList::iterator it = maFontInstanceList.find( aFontSelData );
         if( it != maFontInstanceList.end() )
             pEntry = (*it).second;
     }
 
-    FontSelectPattern aFontSelData(rFontSelData);
     if( !pEntry ) // no direct cache hit
     {
         // find the best matching logical font family and update font selector accordingly
@@ -1318,7 +1318,7 @@ ImplFontEntry* ImplFontCache::GetFontEntry( PhysicalFontCollection* pFontList,
 
         // 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[ rFontSelData ] = pEntry;
+        maFontInstanceList[ aFontSelDataOrig ] = pEntry;
     }
 
     mpFirstEntry = pEntry;


More information about the Libreoffice-commits mailing list