summaryrefslogtreecommitdiff
path: root/vcl/inc
diff options
context:
space:
mode:
authorChris Sherlock <chris.sherlock79@gmail.com>2016-01-28 16:31:30 +1100
committerChris Sherlock <chris.sherlock79@gmail.com>2016-01-29 01:59:55 +0000
commitd1a49df6833ff16f5cbaf98534eaae62693e520b (patch)
tree2bbf60556966b4939f3700cab9d1a6278e6b67f0 /vcl/inc
parent6402164182865d7644d2e93158a23e12a6da3926 (diff)
vcl: add text alignment functions to ImplFont and FontAttributes
ImplFont and FontAttributes now have GetAlignment and SetAlignment, and I have renamed Font::GetAlign to Font::GetAlignment, and Font::SetAlign to Font::SetAlignment. See commit description in 8bfccd3a71d911b6d ("vcl: Create accessor and mutator for font scaling in FontMetric") for reasoning behind patch. Unit test added to vcl/qa/cppunit/font.cxx to test text alignment. Change-Id: I6272c84fc9416c90616d957d1897eba9469fe7ba Reviewed-on: https://gerrit.libreoffice.org/21876 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
Diffstat (limited to 'vcl/inc')
-rw-r--r--vcl/inc/fontattributes.hxx5
-rw-r--r--vcl/inc/impfont.hxx2
2 files changed, 6 insertions, 1 deletions
diff --git a/vcl/inc/fontattributes.hxx b/vcl/inc/fontattributes.hxx
index 870afd34343e..5b8135f33db7 100644
--- a/vcl/inc/fontattributes.hxx
+++ b/vcl/inc/fontattributes.hxx
@@ -39,7 +39,8 @@ public:
FontItalic GetItalic() const { return meItalic; }
FontPitch GetPitch() const { return mePitch; }
FontWidth GetWidthType() const { return meWidthType; }
- rtl_TextEncoding GetCharSet() const { return meCharSet; }
+ TextAlign GetAlignment() const { return meAlign; }
+ rtl_TextEncoding GetCharSet() const { return meCharSet; }
bool IsSymbolFont() const { return mbSymbolFlag; }
@@ -51,6 +52,7 @@ public:
void SetItalic(const FontItalic eItalic ) { meItalic = eItalic; }
void SetWeight(const FontWeight eWeight ) { meWeight = eWeight; }
void SetWidthType(const FontWidth eWidthType) { meWidthType = eWidthType; }
+ void SetAlignment(const TextAlign eAlignment) { meAlign = eAlignment; }
void SetCharSet( const rtl_TextEncoding );
void SetSymbolFlag(const bool );
@@ -101,6 +103,7 @@ private:
FontPitch mePitch; // Pitch Type
FontWidth meWidthType; // Width Type
FontItalic meItalic; // Slant Type
+ TextAlign meAlign; // Text alignment
rtl_TextEncoding meCharSet; // RTL_TEXTENCODING_SYMBOL or RTL_TEXTENCODING_UNICODE
bool mbSymbolFlag; // Is font a symbol?
diff --git a/vcl/inc/impfont.hxx b/vcl/inc/impfont.hxx
index ee353c2155a4..cde8e097821c 100644
--- a/vcl/inc/impfont.hxx
+++ b/vcl/inc/impfont.hxx
@@ -50,6 +50,7 @@ public:
FontPitch GetPitchNoAsk() const { return mePitch; }
FontWidth GetWidthType() { if(meWidthType==WIDTH_DONTKNOW) AskConfig(); return meWidthType; }
FontWidth GetWidthTypeNoAsk() const { return meWidthType; }
+ TextAlign GetAlignment() const { return meAlign; }
rtl_TextEncoding GetCharSet() const { return meCharSet; }
bool IsSymbolFont() const { return mbSymbol; }
@@ -62,6 +63,7 @@ public:
void SetItalic( const FontItalic eItalic ) { meItalic = eItalic; }
void SetWeight( const FontWeight eWeight ) { meWeight = eWeight; }
void SetWidthType( const FontWidth eWidthType ) { meWidthType = eWidthType; }
+ void SetAlignment( const TextAlign eAlignment ) { meAlign = eAlignment; }
void SetCharSet( const rtl_TextEncoding eCharSet ) { meCharSet = eCharSet; }
void SetSymbolFlag( const bool bSymbolFlag ) { mbSymbol = bSymbolFlag; }