diff options
author | Xisco Fauli <anistenis@gmail.com> | 2016-02-07 20:27:05 +0100 |
---|---|---|
committer | jan iversen <jani@documentfoundation.org> | 2016-02-09 14:27:01 +0000 |
commit | 8fbbb923ea752e3c5b147824f0dc04e4b9e27dad (patch) | |
tree | 9f7a79322060ed3c500ae4061aa677cfcfbc414c | |
parent | e9309e1f32e9029b62d67a3706ea63d4c5bb587a (diff) |
SVGIO: tdf#85770: Add import test
Change-Id: Ifffe1d461ae6fa30a9cc61df2ece5716078031ab
Reviewed-on: https://gerrit.libreoffice.org/22190
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: jan iversen <jani@documentfoundation.org>
Tested-by: jan iversen <jani@documentfoundation.org>
-rw-r--r-- | svgio/qa/cppunit/SvgImportTest.cxx | 17 | ||||
-rw-r--r-- | svgio/qa/cppunit/data/tdf85770.svg | 7 | ||||
-rw-r--r-- | test/source/primitive2dxmldump.cxx | 2 |
3 files changed, 26 insertions, 0 deletions
diff --git a/svgio/qa/cppunit/SvgImportTest.cxx b/svgio/qa/cppunit/SvgImportTest.cxx index cc4c2679a4f7..f918a1527946 100644 --- a/svgio/qa/cppunit/SvgImportTest.cxx +++ b/svgio/qa/cppunit/SvgImportTest.cxx @@ -43,6 +43,7 @@ class Test : public test::BootstrapFixture, public XmlTestTools void testFontsizeKeywords(); void testFontsizePercentage(); void testTdf45771(); + void testTdf85770(); Primitive2DSequence parseSvg(const char* aSource); @@ -56,6 +57,7 @@ public: CPPUNIT_TEST(testFontsizeKeywords); CPPUNIT_TEST(testFontsizePercentage); CPPUNIT_TEST(testTdf45771); + CPPUNIT_TEST(testTdf85770); CPPUNIT_TEST_SUITE_END(); }; @@ -204,6 +206,21 @@ void Test::testTdf45771() assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[1]", "height", "32"); } + +void Test::testTdf85770() +{ + Primitive2DSequence aSequenceTdf85770 = parseSvg("/svgio/qa/cppunit/data/tdf85770.svg"); + CPPUNIT_ASSERT_EQUAL(1, (int)aSequenceTdf85770.getLength()); + + Primitive2dXmlDump dumper; + xmlDocPtr pDocument = dumper.dumpAndParse(comphelper::sequenceToContainer<Primitive2DContainer>(aSequenceTdf85770)); + + CPPUNIT_ASSERT (pDocument); + + assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[1]", "text", "Start Middle End"); + assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[2]", "text", "Start "); + assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[3]", "text", "End"); +} CPPUNIT_TEST_SUITE_REGISTRATION(Test); } diff --git a/svgio/qa/cppunit/data/tdf85770.svg b/svgio/qa/cppunit/data/tdf85770.svg new file mode 100644 index 000000000000..b1cf9eb3c26e --- /dev/null +++ b/svgio/qa/cppunit/data/tdf85770.svg @@ -0,0 +1,7 @@ +<svg id="svg-root" + xmlns="http://www.w3.org/2000/svg" + xmlns:xlink="http://www.w3.org/1999/xlink" + width="13cm" height="11cm"> +<text x="5" y="35" font-size="x-small">Start Middle End</text> +<text x="5" y="65" font-size="x-small">Start <tspan visibility="hidden">Middle</tspan> End</text> +</svg> diff --git a/test/source/primitive2dxmldump.cxx b/test/source/primitive2dxmldump.cxx index 940dea0fdab4..48fa0d0d2b72 100644 --- a/test/source/primitive2dxmldump.cxx +++ b/test/source/primitive2dxmldump.cxx @@ -178,6 +178,8 @@ void Primitive2dXmlDump::decomposeAndWrite( { rWriter.attribute("height", aScale.getY()); } + + rWriter.attribute("text", pTextSimplePortionPrimitive2D->getText()); rWriter.endElement(); } break; |