summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorChris Sherlock <chris.sherlock79@gmail.com>2016-01-29 13:48:03 +1100
committerChris Sherlock <chris.sherlock79@gmail.com>2016-01-29 13:48:03 +1100
commitadcd5038d9fc8a8ecf8f577330b8af2f7ff6b267 (patch)
treee247ac73359a5fc12d1f9a20d584b7accac97ba4 /vcl
parenta43b7cc56e3a3a145554932025acbca4156a15f1 (diff)
vcl: more harmonization of ImplFont and FontAttributes
+ Added function ImplFont::CompareDeviceIndependentFontAttributes + Renamed ImplFont::mbSymbol to ImplFont::mbSymbolFlag Change-Id: I6325e87a2f38a9949c990453112284c3f8d1fb2f
Diffstat (limited to 'vcl')
-rw-r--r--vcl/inc/impfont.hxx8
-rw-r--r--vcl/source/font/font.cxx33
2 files changed, 36 insertions, 5 deletions
diff --git a/vcl/inc/impfont.hxx b/vcl/inc/impfont.hxx
index 74d541f02e62..8b7151d84da3 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 fa1d6b61148d..c2ae98f0f859 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 )