diff options
author | Matúš Kukan <matus.kukan@collabora.com> | 2014-05-28 15:13:47 +0200 |
---|---|---|
committer | Matúš Kukan <matus.kukan@collabora.com> | 2014-05-28 15:25:52 +0200 |
commit | 16a62079018aea0e72636bdb00576487b4e830b9 (patch) | |
tree | c8356fea22d9ea9da190316ef3a752e8aac92c7b | |
parent | e0ae1e0d96e0f046f68e7166ae9146e411bc7d50 (diff) |
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
-rw-r--r-- | vcl/inc/outdev.h | 2 | ||||
-rw-r--r-- | vcl/source/outdev/font.cxx | 10 |
2 files changed, 6 insertions, 6 deletions
diff --git a/vcl/inc/outdev.h b/vcl/inc/outdev.h index e468ae22534a..dcde57c09ee9 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 d8b77db84134..6de4765e7093 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; |