diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-10-07 12:55:17 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-10-07 12:57:44 +0100 |
commit | 71bb6d6b7273f49189fa2d10010bac4f8dafa7c1 (patch) | |
tree | 941bfac0a3a43f5084338d598a72123dcd976b23 /vcl/generic | |
parent | b72e63fd5a7caf373eb42bedb2f7db49cef04e91 (diff) |
Revert "loplugin:mergeclasses" to fix mac build
because fontsubst.cxx is not built on mac.
move PreMatchFontSubstitution to PhysicalFontCollection.cxx ?
This reverts commit 349700228e4449ace956b30bc65208b9196f0a78.
Change-Id: I007f24313ddfd0eb3db3fd599abcf1eae3da4e9c
Diffstat (limited to 'vcl/generic')
-rw-r--r-- | vcl/generic/fontmanager/fontsubst.cxx | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/vcl/generic/fontmanager/fontsubst.cxx b/vcl/generic/fontmanager/fontsubst.cxx index 26e502cce05b..c84b7ddbe4b1 100644 --- a/vcl/generic/fontmanager/fontsubst.cxx +++ b/vcl/generic/fontmanager/fontsubst.cxx @@ -35,6 +35,19 @@ #include <unotools/fontdefs.hxx> #include <list> +// platform specific font substitution hooks + +class FcPreMatchSubstititution +: public ImplPreMatchFontSubstitution +{ +public: + bool FindFontSubstitute( FontSelectPattern& ) const SAL_OVERRIDE; + typedef ::std::pair<FontSelectPatternAttributes, FontSelectPatternAttributes> value_type; +private: + typedef ::std::list<value_type> CachedFontMapType; + mutable CachedFontMapType maCachedFontMap; +}; + class FcGlyphFallbackSubstititution : public ImplGlyphFallbackFontSubstitution { @@ -82,7 +95,7 @@ void SalGenericInstance::RegisterFontSubstitutors( PhysicalFontCollection* pFont // register font fallback substitutions (unless disabled by bit0) if( (nDisableBits & 1) == 0 ) { - static PreMatchFontSubstititution aSubstPreMatch; + static FcPreMatchSubstititution aSubstPreMatch; pFontCollection->SetPreMatchHook( &aSubstPreMatch ); } @@ -125,12 +138,12 @@ namespace : mrAttributes(rAttributes) { } - bool operator()(const PreMatchFontSubstititution::value_type& rOther) const + bool operator()(const FcPreMatchSubstititution::value_type& rOther) const { return rOther.first == mrAttributes; } }; } -bool PreMatchFontSubstititution::FindFontSubstitute( FontSelectPattern &rFontSelData ) const +bool FcPreMatchSubstititution::FindFontSubstitute( FontSelectPattern &rFontSelData ) const { // We don't actually want to talk to Fontconfig at all for symbol fonts if( rFontSelData.IsSymbolFont() ) |