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

Caolán McNamara caolanm at redhat.com
Wed Oct 7 04:58:59 PDT 2015


 compilerplugins/clang/mergeclasses.results |    1 +
 vcl/generic/fontmanager/fontsubst.cxx      |   19 ++++++++++++++++---
 vcl/inc/PhysicalFontCollection.hxx         |    4 ++--
 vcl/inc/outdev.h                           |   10 +++-------
 vcl/inc/outfont.hxx                        |    2 +-
 vcl/source/font/PhysicalFontCollection.cxx |    2 +-
 6 files changed, 24 insertions(+), 14 deletions(-)

New commits:
commit 71bb6d6b7273f49189fa2d10010bac4f8dafa7c1
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Oct 7 12:55:17 2015 +0100

    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

diff --git a/compilerplugins/clang/mergeclasses.results b/compilerplugins/clang/mergeclasses.results
index ece9c54..78e59dc 100644
--- a/compilerplugins/clang/mergeclasses.results
+++ b/compilerplugins/clang/mergeclasses.results
@@ -46,6 +46,7 @@ merge ISwFrameControl with SwFrameMenuButtonBase
 merge IXFAttrList with XFSaxAttrList
 merge IXFStream with XFSaxStream
 merge IXFStyle with XFStyle
+merge ImplPreMatchFontSubstitution with FcPreMatchSubstititution
 merge LwpDLList with LwpParaProperty
 merge LwpDLVListHead with LwpPropList
 merge OldBasicPassword with basic::SfxScriptLibraryContainer
diff --git a/vcl/generic/fontmanager/fontsubst.cxx b/vcl/generic/fontmanager/fontsubst.cxx
index 26e502c..c84b7dd 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() )
diff --git a/vcl/inc/PhysicalFontCollection.hxx b/vcl/inc/PhysicalFontCollection.hxx
index e2d78d9..1625a35 100644
--- a/vcl/inc/PhysicalFontCollection.hxx
+++ b/vcl/inc/PhysicalFontCollection.hxx
@@ -40,7 +40,7 @@ private:
     typedef std::unordered_map<OUString, PhysicalFontFamily*,OUStringHash> PhysicalFontFamilies;
     PhysicalFontFamilies    maPhysicalFontFamilies;
 
-    PreMatchFontSubstititution* mpPreMatchHook;       // device specific prematch substitution
+    ImplPreMatchFontSubstitution* mpPreMatchHook;       // device specific prematch substitution
     ImplGlyphFallbackFontSubstitution* mpFallbackHook;  // device specific glyph fallback substitution
 
 public:
@@ -63,7 +63,7 @@ public:
                         OUString& rMissingCodes, int nFallbackLevel ) const;
 
     // prepare platform specific font substitutions
-    void                    SetPreMatchHook( PreMatchFontSubstititution* );
+    void                    SetPreMatchHook( ImplPreMatchFontSubstitution* );
     void                    SetFallbackHook( ImplGlyphFallbackFontSubstitution* );
 
     // misc utilities
diff --git a/vcl/inc/outdev.h b/vcl/inc/outdev.h
index 7032958..628329e 100644
--- a/vcl/inc/outdev.h
+++ b/vcl/inc/outdev.h
@@ -112,17 +112,13 @@ public:
 // PreMatchFontSubstitution
 // abstracts the concept of a configured font substitution
 // before the availability of the originally selected font has been checked
-class PreMatchFontSubstititution
+class ImplPreMatchFontSubstitution
+:   public ImplFontSubstitution
 {
 public:
-    bool FindFontSubstitute( FontSelectPattern& ) const;
-    typedef ::std::pair<FontSelectPatternAttributes, FontSelectPatternAttributes> value_type;
-private:
-    typedef ::std::list<value_type> CachedFontMapType;
-    mutable CachedFontMapType maCachedFontMap;
+    virtual bool FindFontSubstitute( FontSelectPattern& ) const = 0;
 };
 
-
 // ImplGlyphFallbackFontSubstitution
 // abstracts the concept of finding the best font to support an incomplete font
 class ImplGlyphFallbackFontSubstitution
diff --git a/vcl/inc/outfont.hxx b/vcl/inc/outfont.hxx
index 860f767..2b56acd 100644
--- a/vcl/inc/outfont.hxx
+++ b/vcl/inc/outfont.hxx
@@ -37,7 +37,7 @@ class ImplGetDevFontList;
 class ImplGetDevSizeList;
 class ImplFontEntry;
 class ImplFontCache;
-class PreMatchFontSubstititution;
+class ImplPreMatchFontSubstitution;
 class ImplGlyphFallbackFontSubstitution;
 class FontSelectPattern;
 namespace vcl { class Font; }
diff --git a/vcl/source/font/PhysicalFontCollection.cxx b/vcl/source/font/PhysicalFontCollection.cxx
index 9f01fe2..cd89bdf 100644
--- a/vcl/source/font/PhysicalFontCollection.cxx
+++ b/vcl/source/font/PhysicalFontCollection.cxx
@@ -84,7 +84,7 @@ PhysicalFontCollection::~PhysicalFontCollection()
     Clear();
 }
 
-void PhysicalFontCollection::SetPreMatchHook( PreMatchFontSubstititution* pHook )
+void PhysicalFontCollection::SetPreMatchHook( ImplPreMatchFontSubstitution* pHook )
 {
     mpPreMatchHook = pHook;
 }


More information about the Libreoffice-commits mailing list