svgio/qa/cppunit/SvgImportTest.cxx | 19 +++++++++++++++++++ svgio/qa/cppunit/data/tdf99994.svg | 8 ++++++++ 2 files changed, 27 insertions(+)
New commits: commit 9bf1dac4be55f8591d5fd2b8aa93c9369191c02c Author: Xisco Fauli <[email protected]> Date: Mon May 30 22:20:51 2016 +0200 tdf#99994: Add unittest Change-Id: I1a58dc21fdcdf8e7688508105fbd6438c7f4bda0 Reviewed-on: https://gerrit.libreoffice.org/25690 Tested-by: Jenkins <[email protected]> Reviewed-by: Xisco Faulà <[email protected]> diff --git a/svgio/qa/cppunit/SvgImportTest.cxx b/svgio/qa/cppunit/SvgImportTest.cxx index 645ad1b..50bd744 100644 --- a/svgio/qa/cppunit/SvgImportTest.cxx +++ b/svgio/qa/cppunit/SvgImportTest.cxx @@ -60,6 +60,7 @@ class Test : public test::BootstrapFixture, public XmlTestTools void test47446(); void test47446b(); void testMaskText(); + void testTdf99994(); Primitive2DSequence parseSvg(const char* aSource); @@ -90,6 +91,7 @@ public: CPPUNIT_TEST(test47446); CPPUNIT_TEST(test47446b); CPPUNIT_TEST(testMaskText); + CPPUNIT_TEST(testTdf99994); CPPUNIT_TEST_SUITE_END(); }; @@ -607,6 +609,23 @@ void Test::testMaskText() assertXPath(pDocument, "/primitive2D/transform/transform/textsimpleportion", "familyname", "Times New Roman"); } +void Test::testTdf99994() +{ + //Check text fontsize when using relative units + Primitive2DSequence aSequenceTdf99994 = parseSvg("/svgio/qa/cppunit/data/tdf99994.svg"); + CPPUNIT_ASSERT_EQUAL(1, (int)aSequenceTdf99994.getLength()); + + Primitive2dXmlDump dumper; + xmlDocPtr pDocument = dumper.dumpAndParse(comphelper::sequenceToContainer<Primitive2DContainer>(aSequenceTdf99994)); + + CPPUNIT_ASSERT (pDocument); + + assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[1]", "fontcolor", "#0000ff"); + assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[1]", "height", "16"); + assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[1]", "text", "test"); + assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[1]", "familyname", "Sans"); +} + CPPUNIT_TEST_SUITE_REGISTRATION(Test); } diff --git a/svgio/qa/cppunit/data/tdf99994.svg b/svgio/qa/cppunit/data/tdf99994.svg new file mode 100644 index 0000000..b4dec35 --- /dev/null +++ b/svgio/qa/cppunit/data/tdf99994.svg @@ -0,0 +1,8 @@ +<svg xmlns="http://www.w3.org/2000/svg"> +<style type="text/css" id="style1"> +*{fill:blue;} +</style> +<text id="text1" style="font-family:Sans;"> + <tspan id="tspan1">test</tspan> +</text> +</svg>
_______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
