update dev300-m57
[ooovba.git] / applied_patches / 0703-fontconfig-cache-pre-substitution.diff
blob3c6dc251c492ad649ef6854335405f1056c4d6cf
1 diff --git vcl/unx/source/gdi/salgdi3.cxx vcl/unx/source/gdi/salgdi3.cxx
2 index 4e165ff..7fc8085 100644
3 --- vcl/unx/source/gdi/salgdi3.cxx
4 +++ vcl/unx/source/gdi/salgdi3.cxx
5 @@ -1988,6 +1988,11 @@ class FcPreMatchSubstititution
7 public:
8 bool FindFontSubstitute( ImplFontSelectData& ) const;
10 +private:
11 + typedef ::std::hash_map< ::rtl::OUString, ::rtl::OUString, ::rtl::OUStringHash >
12 + CachedFontMapType;
13 + mutable CachedFontMapType maCachedFontMap;
16 class FcGlyphFallbackSubstititution
17 @@ -2116,8 +2121,19 @@ bool FcPreMatchSubstititution::FindFontSubstitute( ImplFontSelectData &rFontSelD
18 || 0 == rFontSelData.maSearchName.CompareIgnoreCaseToAscii( "opensymbol", 10) )
19 return false;
21 + CachedFontMapType::const_iterator itr = maCachedFontMap.find(rFontSelData.maTargetName);
22 + if (itr != maCachedFontMap.end())
23 + {
24 + // Cached substitution pair
25 + rFontSelData.maSearchName = itr->second;
26 + return true;
27 + }
28 rtl::OUString aDummy;
29 const rtl::OUString aOUName = GetFcSubstitute( rFontSelData, aDummy );
31 + maCachedFontMap.insert(
32 + CachedFontMapType::value_type(rFontSelData.maTargetName, aOUName));
34 if( !aOUName.getLength() )
35 return false;
36 const String aName( aOUName );