diff options
author | Xisco Fauli <anistenis@gmail.com> | 2016-02-18 01:27:17 +0100 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2016-02-19 06:28:11 +0000 |
commit | 324014c997ab90f5777f772a46e6faf887a00832 (patch) | |
tree | 07f8b8ffbbdfeaad39b2466547b68659c422adce /svgio/qa/cppunit/SvgImportTest.cxx | |
parent | 1b374b2a3080a7191c282f891a562962c872893b (diff) |
SVGIO: Fix problem when relative font-size depends on its...
... parent's font-size
Change-Id: I13943923c401a5a06b3aa51181fd75292534e888
Reviewed-on: https://gerrit.libreoffice.org/22452
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
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 |