diff options
author | Xisco Fauli <anistenis@gmail.com> | 2016-04-12 08:00:51 +0200 |
---|---|---|
committer | Xisco Faulí <anistenis@gmail.com> | 2016-04-12 22:00:53 +0000 |
commit | de32fe50299a8891102528379e291919d2b66f56 (patch) | |
tree | 7abb80e7448e8dd4ef18bc072499679ca58c52e7 /svgio/qa | |
parent | 473472ea3c5e38395a35195f728f5b6ed449318b (diff) |
Change-Id: I86bec5694eb0c85596d2573111ddb355bd3ae09e
Reviewed-on: https://gerrit.libreoffice.org/24011
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Xisco Faulí <anistenis@gmail.com>
Diffstat (limited to 'svgio/qa')
-rw-r--r-- | svgio/qa/cppunit/SvgImportTest.cxx | 34 | ||||
-rw-r--r-- | svgio/qa/cppunit/data/47446.svg | 19 | ||||
-rw-r--r-- | svgio/qa/cppunit/data/47446b.svg | 18 |
3 files changed, 71 insertions, 0 deletions
diff --git a/svgio/qa/cppunit/SvgImportTest.cxx b/svgio/qa/cppunit/SvgImportTest.cxx index 4980a319754f..6ae57af10f88 100644 --- a/svgio/qa/cppunit/SvgImportTest.cxx +++ b/svgio/qa/cppunit/SvgImportTest.cxx @@ -57,6 +57,8 @@ class Test : public test::BootstrapFixture, public XmlTestTools void testClipPathAndStyle(); void testi125329(); void testMaskingPath07b(); + void test47446(); + void test47446b(); Primitive2DSequence parseSvg(const char* aSource); @@ -84,6 +86,8 @@ public: CPPUNIT_TEST(testClipPathAndStyle); CPPUNIT_TEST(testi125329); CPPUNIT_TEST(testMaskingPath07b); + CPPUNIT_TEST(test47446); + CPPUNIT_TEST(test47446b); CPPUNIT_TEST_SUITE_END(); }; @@ -484,6 +488,36 @@ void Test::testMaskingPath07b() } +void Test::test47446() +{ + //Check that marker's fill attribute is black is not set + Primitive2DSequence aSequence47446 = parseSvg("/svgio/qa/cppunit/data/47446.svg"); + CPPUNIT_ASSERT_EQUAL(1, (int)aSequence47446.getLength()); + + Primitive2dXmlDump dumper; + xmlDocPtr pDocument = dumper.dumpAndParse(comphelper::sequenceToContainer<Primitive2DContainer>(aSequence47446)); + + CPPUNIT_ASSERT (pDocument); + + assertXPath(pDocument, "/primitive2D/transform/transform/transform/polypolygoncolor", "color", "#000000"); + +} + +void Test::test47446b() +{ + //Check that marker's fill attribute is inherit from def + Primitive2DSequence aSequence47446b = parseSvg("/svgio/qa/cppunit/data/47446b.svg"); + CPPUNIT_ASSERT_EQUAL(1, (int)aSequence47446b.getLength()); + + Primitive2dXmlDump dumper; + xmlDocPtr pDocument = dumper.dumpAndParse(comphelper::sequenceToContainer<Primitive2DContainer>(aSequence47446b)); + + CPPUNIT_ASSERT (pDocument); + + assertXPath(pDocument, "/primitive2D/transform/transform/transform/polypolygoncolor", "color", "#ffff00"); + +} + CPPUNIT_TEST_SUITE_REGISTRATION(Test); } diff --git a/svgio/qa/cppunit/data/47446.svg b/svgio/qa/cppunit/data/47446.svg new file mode 100644 index 000000000000..aec66b9bdc76 --- /dev/null +++ b/svgio/qa/cppunit/data/47446.svg @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="utf-8" standalone="no" ?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
+ "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg width="12cm" height="4cm" viewBox="0 0 1200 400"
+ xmlns="http://www.w3.org/2000/svg" version="1.1">
+<defs>
+ <marker id="Triangle"
+ markerUnits="strokeWidth" refY="3"
+ markerWidth="6" markerHeight="6"
+ orient="auto">
+ <path d="M 0 0 L 6 3 L 0 6 z"
+ stroke-width="0.5" stroke="black"/>
+ </marker>
+</defs>
+
+<polyline fill="none" stroke="red" stroke-width="10"
+ points="450,50 550,50 650,150"
+ marker-end="url(#Triangle)" />
+</svg>
diff --git a/svgio/qa/cppunit/data/47446b.svg b/svgio/qa/cppunit/data/47446b.svg new file mode 100644 index 000000000000..29cfce5d84f6 --- /dev/null +++ b/svgio/qa/cppunit/data/47446b.svg @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="utf-8" standalone="no" ?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
+ "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg width="12cm" height="4cm" viewBox="0 0 1200 400"
+ xmlns="http://www.w3.org/2000/svg" version="1.1">
+<defs fill="yellow">
+ <marker id="Triangle"
+ markerUnits="strokeWidth" refY="3"
+ markerWidth="6" markerHeight="6"
+ orient="auto">
+ <path d="M 0 0 L 6 3 L 0 6 z"
+ stroke-width="0.5" stroke="black"/>
+ </marker>
+</defs>
+<polyline fill="none" stroke="red" stroke-width="10"
+ points="450,50 550,50 650,150"
+ marker-end="url(#Triangle)" />
+</svg>
|