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

Chris Sherlock chris.sherlock79 at gmail.com
Fri Jan 9 12:43:04 PST 2015


 vcl/inc/cairotextrender.hxx             |  104 ++++++++++++++++----------------
 vcl/inc/textrender.hxx                  |   71 +++++++++++----------
 vcl/unx/generic/gdi/cairotextrender.cxx |   12 +--
 3 files changed, 99 insertions(+), 88 deletions(-)

New commits:
commit b3c6f2765602290fecd1f1e291e11667b6b446b6
Author: Chris Sherlock <chris.sherlock79 at gmail.com>
Date:   Fri Jan 9 18:40:42 2015 +1100

    vcl: CairoTextRender::nTextColor_ to mnTextColor
    
    Change-Id: Ia53dc393e4284989f6e967c4fa42e7ba6fc58183

diff --git a/vcl/inc/cairotextrender.hxx b/vcl/inc/cairotextrender.hxx
index 2a95903..d59d75c 100644
--- a/vcl/inc/cairotextrender.hxx
+++ b/vcl/inc/cairotextrender.hxx
@@ -73,7 +73,7 @@ class CairoTextRender : public TextRenderImpl
     bool            mbPrinter;
     ServerFont*     mpServerFont[ MAX_FALLBACK ];
 
-    SalColor        nTextColor_;
+    SalColor        mnTextColor;
     CairoFontsCache m_aCairoFontsCache;
 
     bool            bDisableGraphite_;
diff --git a/vcl/unx/generic/gdi/cairotextrender.cxx b/vcl/unx/generic/gdi/cairotextrender.cxx
index 589b53a..7b0438e 100644
--- a/vcl/unx/generic/gdi/cairotextrender.cxx
+++ b/vcl/unx/generic/gdi/cairotextrender.cxx
@@ -42,7 +42,7 @@
 
 CairoTextRender::CairoTextRender(bool bPrinter):
     mbPrinter(bPrinter),
-    nTextColor_(MAKE_SALCOLOR(0x00, 0x00, 0x00)) //black
+    mnTextColor(MAKE_SALCOLOR(0x00, 0x00, 0x00)) //black
 {
     for( int i = 0; i < MAX_FALLBACK; ++i )
         mpServerFont[i] = NULL;
@@ -229,9 +229,9 @@ void CairoTextRender::DrawServerFontLayout( const ServerFontLayout& rLayout )
     clipRegion(cr);
 
     cairo_set_source_rgb(cr,
-        SALCOLOR_RED(nTextColor_)/255.0,
-        SALCOLOR_GREEN(nTextColor_)/255.0,
-        SALCOLOR_BLUE(nTextColor_)/255.0);
+        SALCOLOR_RED(mnTextColor)/255.0,
+        SALCOLOR_GREEN(mnTextColor)/255.0,
+        SALCOLOR_BLUE(mnTextColor)/255.0);
 
     ServerFont& rFont = rLayout.GetServerFont();
 
@@ -380,9 +380,9 @@ sal_uInt16 CairoTextRender::SetFont( FontSelectPattern *pEntry, int nFallbackLev
 void
 CairoTextRender::SetTextColor( SalColor nSalColor )
 {
-    if( nTextColor_ != nSalColor )
+    if( mnTextColor != nSalColor )
     {
-        nTextColor_ = nSalColor;
+        mnTextColor = nSalColor;
     }
 }
 
commit 49a6d0151d85ddc64857c66c97c577ebd438a392
Author: Chris Sherlock <chris.sherlock79 at gmail.com>
Date:   Fri Jan 9 18:35:38 2015 +1100

    vcl: cleanup cairotextrender.hxx
    
    Change-Id: Ia8471c9745b86c4137297fd9cd0a3fea712a14fa

diff --git a/vcl/inc/cairotextrender.hxx b/vcl/inc/cairotextrender.hxx
index 2b8a21e..2a95903 100644
--- a/vcl/inc/cairotextrender.hxx
+++ b/vcl/inc/cairotextrender.hxx
@@ -55,74 +55,80 @@ public:
                 mbVerticalMetrics == rOther.mbVerticalMetrics;
         }
     };
+
 private:
-    static int mnRefCount;
-    typedef std::deque< std::pair<void *, CacheId> > LRUFonts;
+    static int      mnRefCount;
+    typedef         std::deque< std::pair<void *, CacheId> > LRUFonts;
     static LRUFonts maLRUFonts;
 public:
-    CairoFontsCache();
-    static void  CacheFont(void *pFont, const CacheId &rId);
-    static void* FindCachedFont(const CacheId &rId);
-    ~CairoFontsCache();
+                                CairoFontsCache();
+                                ~CairoFontsCache();
+
+    static void                 CacheFont(void *pFont, const CacheId &rId);
+    static void*                FindCachedFont(const CacheId &rId);
 };
 
 class CairoTextRender : public TextRenderImpl
 {
-    bool mbPrinter;
-    ServerFont* mpServerFont[ MAX_FALLBACK ];
+    bool            mbPrinter;
+    ServerFont*     mpServerFont[ MAX_FALLBACK ];
 
-    SalColor nTextColor_;
+    SalColor        nTextColor_;
     CairoFontsCache m_aCairoFontsCache;
 
+    bool            bDisableGraphite_;
+
 protected:
-    virtual GlyphCache& getPlatformGlyphCache() = 0;
-    virtual cairo_surface_t* getCairoSurface() = 0;
-    virtual void getSurfaceOffset(double& nDX, double& nDY) = 0;
-    virtual void drawSurface(cairo_t* cr) = 0;
+    virtual GlyphCache&         getPlatformGlyphCache() = 0;
+    virtual cairo_surface_t*    getCairoSurface() = 0;
+    virtual void                getSurfaceOffset(double& nDX, double& nDY) = 0;
+    virtual void                drawSurface(cairo_t* cr) = 0;
 
-bool setFont( const FontSelectPattern *pEntry, int nFallbackLevel );
+    bool                        setFont( const FontSelectPattern *pEntry, int nFallbackLevel );
 
-    virtual void clipRegion(cairo_t* cr) = 0;
+    virtual void                clipRegion(cairo_t* cr) = 0;
 
 public:
-    CairoTextRender(bool bPrinter);
+                                CairoTextRender(bool bPrinter);
 
 
-    virtual void            SetTextColor( SalColor nSalColor ) SAL_OVERRIDE;
+    virtual void                SetTextColor( SalColor nSalColor ) SAL_OVERRIDE;
     virtual sal_uInt16          SetFont( FontSelectPattern*, int nFallbackLevel ) SAL_OVERRIDE;
-    virtual void            GetFontMetric( ImplFontMetricData*, int nFallbackLevel ) SAL_OVERRIDE;
+    virtual void                GetFontMetric( ImplFontMetricData*, int nFallbackLevel ) SAL_OVERRIDE;
     virtual const FontCharMapPtr GetFontCharMap() const SAL_OVERRIDE;
-    virtual bool GetFontCapabilities(vcl::FontCapabilities &rFontCapabilities) const SAL_OVERRIDE;
-    virtual void            GetDevFontList( PhysicalFontCollection* ) SAL_OVERRIDE;
-    virtual void ClearDevFontCache() SAL_OVERRIDE;
-    virtual bool            AddTempDevFont( PhysicalFontCollection*, const OUString& rFileURL, const OUString& rFontName ) SAL_OVERRIDE;
-    virtual bool            CreateFontSubset( const OUString& rToFile,
-                                              const PhysicalFontFace*,
-                                              sal_GlyphId* pGlyphIDs,
-                                              sal_uInt8* pEncoding,
-                                              sal_Int32* pWidths,
-                                              int nGlyphs,
-                                              FontSubsetInfo& rInfo
-                                              ) SAL_OVERRIDE;
-    virtual const Ucs2SIntMap* GetFontEncodingVector( const PhysicalFontFace*, const Ucs2OStrMap** ppNonEncoded ) SAL_OVERRIDE;
-    virtual const void* GetEmbedFontData( const PhysicalFontFace*,
-                                          const sal_Ucs* pUnicodes,
-                                          sal_Int32* pWidths,
-                                          FontSubsetInfo& rInfo,
-                                          long* pDataLen ) SAL_OVERRIDE;
-    virtual void            FreeEmbedFontData( const void* pData, long nDataLen ) SAL_OVERRIDE;
-    virtual void            GetGlyphWidths( const PhysicalFontFace*,
-                                            bool bVertical,
-                                            Int32Vector& rWidths,
-                                            Ucs2UIntMap& rUnicodeEnc ) SAL_OVERRIDE;
-    virtual bool            GetGlyphBoundRect( sal_GlyphId nIndex, Rectangle& ) SAL_OVERRIDE;
-    virtual bool            GetGlyphOutline( sal_GlyphId nIndex, ::basegfx::B2DPolyPolygon& ) SAL_OVERRIDE;
-    virtual SalLayout*      GetTextLayout( ImplLayoutArgs&, int nFallbackLevel ) SAL_OVERRIDE;
-    virtual void            DrawServerFontLayout( const ServerFontLayout& ) SAL_OVERRIDE;
-    virtual SystemFontData  GetSysFontData( int nFallbackLevel ) const SAL_OVERRIDE;
-
-private:
-    bool            bDisableGraphite_;
+    virtual bool                GetFontCapabilities(vcl::FontCapabilities &rFontCapabilities) const SAL_OVERRIDE;
+    virtual void                GetDevFontList( PhysicalFontCollection* ) SAL_OVERRIDE;
+    virtual void                ClearDevFontCache() SAL_OVERRIDE;
+    virtual bool                AddTempDevFont( PhysicalFontCollection*, const OUString& rFileURL, const OUString& rFontName ) SAL_OVERRIDE;
+    virtual bool                CreateFontSubset(
+                                    const OUString& rToFile,
+                                    const PhysicalFontFace*,
+                                    sal_GlyphId* pGlyphIDs,
+                                    sal_uInt8* pEncoding,
+                                    sal_Int32* pWidths,
+                                    int nGlyphs,
+                                    FontSubsetInfo& rInfo) SAL_OVERRIDE;
+
+    virtual const Ucs2SIntMap*  GetFontEncodingVector( const PhysicalFontFace*, const Ucs2OStrMap** ppNonEncoded ) SAL_OVERRIDE;
+    virtual const void*         GetEmbedFontData(
+                                    const PhysicalFontFace*,
+                                    const sal_Ucs* pUnicodes,
+                                    sal_Int32* pWidths,
+                                    FontSubsetInfo& rInfo,
+                                    long* pDataLen ) SAL_OVERRIDE;
+
+    virtual void                FreeEmbedFontData( const void* pData, long nDataLen ) SAL_OVERRIDE;
+    virtual void                GetGlyphWidths(
+                                    const PhysicalFontFace*,
+                                    bool bVertical,
+                                    Int32Vector& rWidths,
+                                    Ucs2UIntMap& rUnicodeEnc ) SAL_OVERRIDE;
+
+    virtual bool                GetGlyphBoundRect( sal_GlyphId nIndex, Rectangle& ) SAL_OVERRIDE;
+    virtual bool                GetGlyphOutline( sal_GlyphId nIndex, ::basegfx::B2DPolyPolygon& ) SAL_OVERRIDE;
+    virtual SalLayout*          GetTextLayout( ImplLayoutArgs&, int nFallbackLevel ) SAL_OVERRIDE;
+    virtual void                DrawServerFontLayout( const ServerFontLayout& ) SAL_OVERRIDE;
+    virtual SystemFontData      GetSysFontData( int nFallbackLevel ) const SAL_OVERRIDE;
 };
 
 #endif
commit d1d1f0c2164fcbef40ff98edfe691a29bfaea280
Author: Chris Sherlock <chris.sherlock79 at gmail.com>
Date:   Fri Jan 9 18:28:31 2015 +1100

    vcl: cleanup textrender.hxx
    
    Change-Id: Id8524328f1bdacbc37dd6846f053e5bcfbcd782c

diff --git a/vcl/inc/textrender.hxx b/vcl/inc/textrender.hxx
index f4dcc83..bdb55bd 100644
--- a/vcl/inc/textrender.hxx
+++ b/vcl/inc/textrender.hxx
@@ -42,40 +42,45 @@ class TextRenderImpl
 public:
     virtual ~TextRenderImpl() {}
 
-    virtual void            SetTextColor( SalColor nSalColor ) = 0;
-    virtual sal_uInt16          SetFont( FontSelectPattern*, int nFallbackLevel ) = 0;
-    virtual void            GetFontMetric( ImplFontMetricData*, int nFallbackLevel ) = 0;
-    virtual const FontCharMapPtr GetFontCharMap() const = 0;
-    virtual bool GetFontCapabilities(vcl::FontCapabilities &rFontCapabilities) const = 0;
-    virtual void            GetDevFontList( PhysicalFontCollection* ) = 0;
-    virtual void ClearDevFontCache() = 0;
-    virtual bool            AddTempDevFont( PhysicalFontCollection*, const OUString& rFileURL, const OUString& rFontName ) = 0;
-    virtual bool            CreateFontSubset( const OUString& rToFile,
-                                              const PhysicalFontFace*,
-                                              sal_GlyphId* pGlyphIDs,
-                                              sal_uInt8* pEncoding,
-                                              sal_Int32* pWidths,
-                                              int nGlyphs,
-                                              FontSubsetInfo& rInfo
-                                              ) = 0;
-    virtual const Ucs2SIntMap* GetFontEncodingVector( const PhysicalFontFace*, const Ucs2OStrMap** ppNonEncoded ) = 0;
-    virtual const void* GetEmbedFontData( const PhysicalFontFace*,
-                                          const sal_Ucs* pUnicodes,
-                                          sal_Int32* pWidths,
-                                          FontSubsetInfo& rInfo,
-                                          long* pDataLen ) = 0;
-    virtual void            FreeEmbedFontData( const void* pData, long nDataLen ) = 0;
-    virtual void            GetGlyphWidths( const PhysicalFontFace*,
-                                            bool bVertical,
-                                            Int32Vector& rWidths,
-                                            Ucs2UIntMap& rUnicodeEnc ) = 0;
-    virtual bool            GetGlyphBoundRect( sal_GlyphId nIndex, Rectangle& ) = 0;
-    virtual bool            GetGlyphOutline( sal_GlyphId nIndex, ::basegfx::B2DPolyPolygon& ) = 0;
-    virtual SalLayout*      GetTextLayout( ImplLayoutArgs&, int nFallbackLevel ) = 0;
-    virtual void            DrawServerFontLayout( const ServerFontLayout& ) = 0;
-    virtual SystemFontData  GetSysFontData( int nFallbackLevel ) const = 0;
+    virtual void                    SetTextColor( SalColor nSalColor ) = 0;
+    virtual sal_uInt16              SetFont( FontSelectPattern*, int nFallbackLevel ) = 0;
+    virtual void                    GetFontMetric( ImplFontMetricData*, int nFallbackLevel ) = 0;
+    virtual const FontCharMapPtr    GetFontCharMap() const = 0;
+    virtual bool                    GetFontCapabilities(vcl::FontCapabilities &rFontCapabilities) const = 0;
+    virtual void                    GetDevFontList( PhysicalFontCollection* ) = 0;
+    virtual void                    ClearDevFontCache() = 0;
+    virtual bool                    AddTempDevFont( PhysicalFontCollection*, const OUString& rFileURL, const OUString& rFontName ) = 0;
+    virtual bool                    CreateFontSubset(
+                                        const OUString& rToFile,
+                                        const PhysicalFontFace*,
+                                        sal_GlyphId* pGlyphIDs,
+                                        sal_uInt8* pEncoding,
+                                        sal_Int32* pWidths,
+                                        int nGlyphs,
+                                        FontSubsetInfo& rInfo) = 0;
+
+    virtual const Ucs2SIntMap*      GetFontEncodingVector( const PhysicalFontFace*, const Ucs2OStrMap** ppNonEncoded ) = 0;
+    virtual const void*             GetEmbedFontData(
+                                        const PhysicalFontFace*,
+                                        const sal_Ucs* pUnicodes,
+                                        sal_Int32* pWidths,
+                                        FontSubsetInfo& rInfo,
+                                        long* pDataLen ) = 0;
+
+    virtual void                    FreeEmbedFontData( const void* pData, long nDataLen ) = 0;
+    virtual void                    GetGlyphWidths(
+                                        const PhysicalFontFace*,
+                                        bool bVertical,
+                                        Int32Vector& rWidths,
+                                        Ucs2UIntMap& rUnicodeEnc ) = 0;
+
+    virtual bool                    GetGlyphBoundRect( sal_GlyphId nIndex, Rectangle& ) = 0;
+    virtual bool                    GetGlyphOutline( sal_GlyphId nIndex, ::basegfx::B2DPolyPolygon& ) = 0;
+    virtual SalLayout*              GetTextLayout( ImplLayoutArgs&, int nFallbackLevel ) = 0;
+    virtual void                    DrawServerFontLayout( const ServerFontLayout& ) = 0;
+    virtual SystemFontData          GetSysFontData( int nFallbackLevel ) const = 0;
 };
 
 #endif
 
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set tabstop=4 shiftwidth=4 softtabstop=4 expandtab: */


More information about the Libreoffice-commits mailing list