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

Stephan Bergmann sbergman at redhat.com
Mon Aug 29 15:53:43 UTC 2016


 vcl/inc/unx/cairotextrender.hxx         |   30 -------------------------
 vcl/unx/generic/gdi/cairotextrender.cxx |   38 ++++++++++++++++++++++++++++++--
 2 files changed, 36 insertions(+), 32 deletions(-)

New commits:
commit 66e2f20c5610eb500b4a9cf22ef024492ba0fd00
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Mon Aug 29 17:50:44 2016 +0200

    CairoFontsCache is only used in cairotextrender.cxx
    
    ...so move it there and remove the VCL_DLLPUBLIC
    
    Change-Id: I1fc75984f8a9935e34cd9ac36d878809b538bd1e

diff --git a/vcl/inc/unx/cairotextrender.hxx b/vcl/inc/unx/cairotextrender.hxx
index 1e2eb9c..8c67813 100644
--- a/vcl/inc/unx/cairotextrender.hxx
+++ b/vcl/inc/unx/cairotextrender.hxx
@@ -26,40 +26,10 @@
 
 #include <deque>
 
-typedef struct FT_FaceRec_* FT_Face;
-
 class ServerFont;
 class GlyphCache;
 typedef struct _cairo cairo_t;
 
-class VCL_DLLPUBLIC CairoFontsCache
-{
-public:
-    struct CacheId
-    {
-        FT_Face maFace;
-        const void *mpOptions;
-        bool mbEmbolden;
-        bool mbVerticalMetrics;
-        bool operator ==(const CacheId& rOther) const
-        {
-            return maFace == rOther.maFace &&
-                mpOptions == rOther.mpOptions &&
-                mbEmbolden == rOther.mbEmbolden &&
-                mbVerticalMetrics == rOther.mbVerticalMetrics;
-        }
-    };
-
-private:
-    typedef         std::deque< std::pair<void *, CacheId> > LRUFonts;
-    static LRUFonts maLRUFonts;
-public:
-                                CairoFontsCache() = delete;
-
-    static void                 CacheFont(void *pFont, const CacheId &rId);
-    static void*                FindCachedFont(const CacheId &rId);
-};
-
 class VCL_DLLPUBLIC CairoTextRender : public TextRenderImpl
 {
     ServerFont*     mpServerFont[ MAX_FALLBACK ];
diff --git a/vcl/unx/generic/gdi/cairotextrender.cxx b/vcl/unx/generic/gdi/cairotextrender.cxx
index d1ad180..d865393 100644
--- a/vcl/unx/generic/gdi/cairotextrender.cxx
+++ b/vcl/unx/generic/gdi/cairotextrender.cxx
@@ -43,6 +43,42 @@
 #include <cairo.h>
 #include <cairo-ft.h>
 
+namespace {
+
+typedef struct FT_FaceRec_* FT_Face;
+
+class CairoFontsCache
+{
+public:
+    struct CacheId
+    {
+        FT_Face maFace;
+        const void *mpOptions;
+        bool mbEmbolden;
+        bool mbVerticalMetrics;
+        bool operator ==(const CacheId& rOther) const
+        {
+            return maFace == rOther.maFace &&
+                mpOptions == rOther.mpOptions &&
+                mbEmbolden == rOther.mbEmbolden &&
+                mbVerticalMetrics == rOther.mbVerticalMetrics;
+        }
+    };
+
+private:
+    typedef         std::deque< std::pair<void *, CacheId> > LRUFonts;
+    static LRUFonts maLRUFonts;
+public:
+                                CairoFontsCache() = delete;
+
+    static void                 CacheFont(void *pFont, const CacheId &rId);
+    static void*                FindCachedFont(const CacheId &rId);
+};
+
+CairoFontsCache::LRUFonts CairoFontsCache::maLRUFonts;
+
+}
+
 CairoTextRender::CairoTextRender()
     : mnTextColor(MAKE_SALCOLOR(0x00, 0x00, 0x00)) //black
 {
@@ -118,8 +154,6 @@ void ServerFontInstance::HandleFontOptions()
     mpServerFont->SetFontOptions(mxFontOptions);
 }
 
-CairoFontsCache::LRUFonts CairoFontsCache::maLRUFonts;
-
 void CairoFontsCache::CacheFont(void *pFont, const CairoFontsCache::CacheId &rId)
 {
     maLRUFonts.push_front( std::pair<void*, CairoFontsCache::CacheId>(pFont, rId) );


More information about the Libreoffice-commits mailing list