summaryrefslogtreecommitdiff
path: root/vcl/qa
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/qa
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/qa')
-rw-r--r--vcl/qa/cppunit/font.cxx14
1 files changed, 14 insertions, 0 deletions
diff --git a/vcl/qa/cppunit/font.cxx b/vcl/qa/cppunit/font.cxx
index 5a8ad8384523..d496ebe418d3 100644
--- a/vcl/qa/cppunit/font.cxx
+++ b/vcl/qa/cppunit/font.cxx
@@ -26,6 +26,7 @@ public:
void testWidthType();
void testPitch();
void testItalic();
+ void testAlignment();
void testQuality();
void testBuiltInFontFlag();
void testEmbeddableFontFlag();
@@ -39,6 +40,7 @@ public:
CPPUNIT_TEST(testWidthType);
CPPUNIT_TEST(testPitch);
CPPUNIT_TEST(testItalic);
+ CPPUNIT_TEST(testAlignment);
CPPUNIT_TEST(testQuality);
CPPUNIT_TEST(testBuiltInFontFlag);
CPPUNIT_TEST(testEmbeddableFontFlag);
@@ -91,6 +93,18 @@ void VclFontTest::testItalic()
CPPUNIT_ASSERT_EQUAL_MESSAGE( "Italic should be EXPANDED", FontItalic::ITALIC_NORMAL, aFont.GetItalic());
}
+
+void VclFontTest::testAlignment()
+{
+ vcl::Font aFont;
+
+ CPPUNIT_ASSERT_EQUAL_MESSAGE( "Text alignment should be ALIGN_TOP", TextAlign::ALIGN_TOP, aFont.GetAlignment());
+
+ aFont.SetAlignment(TextAlign::ALIGN_BASELINE);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE( "Text alignment should be ALIGN_BASELINE", TextAlign::ALIGN_BASELINE, aFont.GetAlignment());
+}
+
+
void VclFontTest::testPitch()
{
vcl::Font aFont;