diff options
Diffstat (limited to 'svgio/qa/cppunit')
-rw-r--r-- | svgio/qa/cppunit/SvgImportTest.cxx | 21 | ||||
-rw-r--r-- | svgio/qa/cppunit/data/ClipPathAndStyle.svg | 13 |
2 files changed, 34 insertions, 0 deletions
diff --git a/svgio/qa/cppunit/SvgImportTest.cxx b/svgio/qa/cppunit/SvgImportTest.cxx index c4b681bd242d..046d905e5036 100644 --- a/svgio/qa/cppunit/SvgImportTest.cxx +++ b/svgio/qa/cppunit/SvgImportTest.cxx @@ -54,6 +54,7 @@ class Test : public test::BootstrapFixture, public XmlTestTools void testRGBAColor(); void testTdf97936(); void testClipPathAndParentStyle(); + void testClipPathAndStyle(); Primitive2DSequence parseSvg(const char* aSource); @@ -78,6 +79,7 @@ public: CPPUNIT_TEST(testRGBAColor); CPPUNIT_TEST(testTdf97936); CPPUNIT_TEST(testClipPathAndParentStyle); + CPPUNIT_TEST(testClipPathAndStyle); CPPUNIT_TEST_SUITE_END(); }; @@ -423,6 +425,25 @@ void Test::testClipPathAndParentStyle() assertXPath(pDocument, "/primitive2D/transform/polypolygonstroke/line", "width", "5"); } + +void Test::testClipPathAndStyle() +{ + //Check that fill color, stroke color and stroke-width are inherited from use element + //when the element is within a clipPath element + Primitive2DSequence aSequenceClipPathAndStyle = parseSvg("/svgio/qa/cppunit/data/ClipPathAndStyle.svg"); + CPPUNIT_ASSERT_EQUAL(1, (int)aSequenceClipPathAndStyle.getLength()); + + Primitive2dXmlDump dumper; + xmlDocPtr pDocument = dumper.dumpAndParse(comphelper::sequenceToContainer<Primitive2DContainer>(aSequenceClipPathAndStyle)); + + CPPUNIT_ASSERT (pDocument); + + assertXPath(pDocument, "/primitive2D/transform/polypolygoncolor", "color", "#ccccff"); + assertXPath(pDocument, "/primitive2D/transform/polypolygonstroke/line", "color", "#0000cc"); + assertXPath(pDocument, "/primitive2D/transform/polypolygonstroke/line", "width", "2"); + +} + CPPUNIT_TEST_SUITE_REGISTRATION(Test); } diff --git a/svgio/qa/cppunit/data/ClipPathAndStyle.svg b/svgio/qa/cppunit/data/ClipPathAndStyle.svg new file mode 100644 index 000000000000..29814fadbb86 --- /dev/null +++ b/svgio/qa/cppunit/data/ClipPathAndStyle.svg @@ -0,0 +1,13 @@ +<svg version="1.1" baseProfile="basic" id="svg-root"
+ width="100%" height="100%" viewBox="0 0 480 360"
+ xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+ <clipPath>
+ <circle id="c1" cx="100" cy="100" r="50"
+ style="stroke: #0000cc;
+ stroke-width: 2px;
+ fill : #ccccff;"/>
+ </clipPath>
+
+ <use xlink:href="#c1" style="fill:red" stroke-width="5px" stroke="black"/>
+
+</svg>
\ No newline at end of file |