diff options
Diffstat (limited to 'svgio/qa/cppunit/SvgImportTest.cxx')
-rw-r--r-- | svgio/qa/cppunit/SvgImportTest.cxx | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/svgio/qa/cppunit/SvgImportTest.cxx b/svgio/qa/cppunit/SvgImportTest.cxx index 78701880f3eb..e5d2b03414d0 100644 --- a/svgio/qa/cppunit/SvgImportTest.cxx +++ b/svgio/qa/cppunit/SvgImportTest.cxx @@ -42,6 +42,7 @@ class Test : public test::BootstrapFixture, public XmlTestTools void testTdf87309(); void testFontsizeKeywords(); void testFontsizePercentage(); + void testFontsizeRelative(); void testTdf45771(); void testTdf97941(); void testTdf85770(); @@ -63,6 +64,7 @@ public: CPPUNIT_TEST(testTdf87309); CPPUNIT_TEST(testFontsizeKeywords); CPPUNIT_TEST(testFontsizePercentage); + CPPUNIT_TEST(testFontsizeRelative); CPPUNIT_TEST(testTdf45771); CPPUNIT_TEST(testTdf97941); CPPUNIT_TEST(testTdf85770); @@ -197,6 +199,7 @@ void Test::testFontsizeKeywords() void Test::testFontsizePercentage() { + //Check when font-size uses percentage and defined globally Primitive2DSequence aSequenceFontsizePercentage = parseSvg("/svgio/qa/cppunit/data/FontsizePercentage.svg"); CPPUNIT_ASSERT_EQUAL(1, (int)aSequenceFontsizePercentage.getLength()); @@ -208,6 +211,20 @@ void Test::testFontsizePercentage() assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[1]", "height", "16"); } +void Test::testFontsizeRelative() +{ + //Check when font-size uses relative units (em,ex) and it's based on its parent's font-size + Primitive2DSequence aSequenceFontsizeRelative = parseSvg("/svgio/qa/cppunit/data/FontsizeRelative.svg"); + CPPUNIT_ASSERT_EQUAL(1, (int)aSequenceFontsizeRelative.getLength()); + + Primitive2dXmlDump dumper; + xmlDocPtr pDocument = dumper.dumpAndParse(comphelper::sequenceToContainer<Primitive2DContainer>(aSequenceFontsizeRelative)); + + CPPUNIT_ASSERT (pDocument); + + assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[1]", "height", "50"); +} + void Test::testTdf45771() { //Check text fontsize when using relative units |