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

Chris Sherlock chris.sherlock79 at gmail.com
Thu Jan 28 18:50:32 PST 2016


 vcl/inc/impfont.hxx      |    8 +++++---
 vcl/source/font/font.cxx |   33 +++++++++++++++++++++++++++++++--
 2 files changed, 36 insertions(+), 5 deletions(-)

New commits:
commit adcd5038d9fc8a8ecf8f577330b8af2f7ff6b267
Author: Chris Sherlock <chris.sherlock79 at gmail.com>
Date:   Fri Jan 29 13:48:03 2016 +1100

    vcl: more harmonization of ImplFont and FontAttributes
    
    + Added function ImplFont::CompareDeviceIndependentFontAttributes
    + Renamed ImplFont::mbSymbol to ImplFont::mbSymbolFlag
    
    Change-Id: I6325e87a2f38a9949c990453112284c3f8d1fb2f

diff --git a/vcl/inc/impfont.hxx b/vcl/inc/impfont.hxx
index 74d541f..8b7151d 100644
--- a/vcl/inc/impfont.hxx
+++ b/vcl/inc/impfont.hxx
@@ -48,7 +48,7 @@ public:
     TextAlign           GetAlignment() const                            { return meAlign; }
     rtl_TextEncoding    GetCharSet() const                              { return meCharSet; }
 
-    bool                IsSymbolFont() const                            { return mbSymbol; }
+    bool                IsSymbolFont() const                            { return mbSymbolFlag; }
 
     void                SetFamilyName( const OUString& sFamilyName )    { maFamilyName = sFamilyName; }
     void                SetStyleName( const OUString& sStyleName )      { maStyleName = sStyleName; }
@@ -61,7 +61,9 @@ public:
     void                SetAlignment( const TextAlign eAlignment )      { meAlign = eAlignment; }
     void                SetCharSet( const rtl_TextEncoding eCharSet )   { meCharSet = eCharSet; }
 
-    void                SetSymbolFlag( const bool bSymbolFlag )         { mbSymbol = bSymbolFlag; }
+    void                SetSymbolFlag( const bool bSymbolFlag )         { mbSymbolFlag = bSymbolFlag; }
+
+    bool                CompareDeviceIndependentFontAttributes(const ImplFont& rOther) const;
 
     // straight properties, no getting them from AskConfig()
     FontFamily          GetFamilyTypeNoAsk() const                      { return meFamily; }
@@ -128,7 +130,7 @@ private:
     LanguageTag         maCJKLanguageTag;
 
     // Flags - device independent
-    bool                mbSymbol:1,
+    bool                mbSymbolFlag:1,
                         mbOutline:1,
                         mbConfigLookup:1,   // there was a config lookup
                         mbShadow:1,
diff --git a/vcl/source/font/font.cxx b/vcl/source/font/font.cxx
index fa1d6b6..c2ae98f 100644
--- a/vcl/source/font/font.cxx
+++ b/vcl/source/font/font.cxx
@@ -856,7 +856,7 @@ ImplFont::ImplFont() :
     meCharSet( RTL_TEXTENCODING_DONTKNOW ),
     maLanguageTag( LANGUAGE_DONTKNOW ),
     maCJKLanguageTag( LANGUAGE_DONTKNOW ),
-    mbSymbol( false ),
+    mbSymbolFlag( false ),
     mbOutline( false ),
     mbConfigLookup( false ),
     mbShadow( false ),
@@ -893,7 +893,7 @@ ImplFont::ImplFont( const ImplFont& rImplFont ) :
     meCharSet( rImplFont.meCharSet ),
     maLanguageTag( rImplFont.maLanguageTag ),
     maCJKLanguageTag( rImplFont.maCJKLanguageTag ),
-    mbSymbol( rImplFont.mbSymbol ),
+    mbSymbolFlag( rImplFont.mbSymbolFlag ),
     mbOutline( rImplFont.mbOutline ),
     mbConfigLookup( rImplFont.mbConfigLookup ),
     mbShadow( rImplFont.mbShadow ),
@@ -953,6 +953,35 @@ bool ImplFont::operator==( const ImplFont& rOther ) const
     return true;
 }
 
+bool ImplFont::CompareDeviceIndependentFontAttributes(const ImplFont& rOther) const
+{
+    if (maFamilyName != rOther.maFamilyName)
+        return false;
+
+    if (maStyleName != rOther.maStyleName)
+        return false;
+
+    if (meWeight != rOther.meWeight)
+        return false;
+
+    if (meItalic != rOther.meItalic)
+        return false;
+
+    if (meFamily != rOther.meFamily)
+        return false;
+
+    if (mePitch != rOther.mePitch)
+        return false;
+
+    if (meWidthType != rOther.meWidthType)
+        return false;
+
+    if (mbSymbolFlag != rOther.mbSymbolFlag)
+        return false;
+
+    return true;
+}
+
 void ImplFont::AskConfig()
 {
     if( mbConfigLookup )


More information about the Libreoffice-commits mailing list