summaryrefslogtreecommitdiff
path: root/svgio/qa/cppunit/SvgImportTest.cxx
diff options
context:
space:
mode:
authorXisco Fauli <anistenis@gmail.com>2016-03-26 16:23:23 +0100
committerXisco FaulĂ­ <anistenis@gmail.com>2016-03-26 16:20:47 +0000
commitc2d130425cc876cceb96cc7e47636426a9e48fa8 (patch)
treed5de2a66b56872410c23c539b3720f919e8c9b4d /svgio/qa/cppunit/SvgImportTest.cxx
parentae5bf728937a9233a5090adca94c2ffc106ea8b6 (diff)
SVGIO: Shapes within a clippath element might inherit...
... fill, stroke, stroke-width and others attributes from parent element, like use element Change-Id: I911bc50409428e81135b81e6dfc82acd1c21d113 Reviewed-on: https://gerrit.libreoffice.org/23527 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Xisco FaulĂ­ <anistenis@gmail.com>
Diffstat (limited to 'svgio/qa/cppunit/SvgImportTest.cxx')
-rw-r--r--svgio/qa/cppunit/SvgImportTest.cxx20
1 files changed, 20 insertions, 0 deletions
diff --git a/svgio/qa/cppunit/SvgImportTest.cxx b/svgio/qa/cppunit/SvgImportTest.cxx
index feea8179f4d9..c4b681bd242d 100644
--- a/svgio/qa/cppunit/SvgImportTest.cxx
+++ b/svgio/qa/cppunit/SvgImportTest.cxx
@@ -53,6 +53,7 @@ class Test : public test::BootstrapFixture, public XmlTestTools
void testRGBColor();
void testRGBAColor();
void testTdf97936();
+ void testClipPathAndParentStyle();
Primitive2DSequence parseSvg(const char* aSource);
@@ -76,6 +77,7 @@ public:
CPPUNIT_TEST(testRGBColor);
CPPUNIT_TEST(testRGBAColor);
CPPUNIT_TEST(testTdf97936);
+ CPPUNIT_TEST(testClipPathAndParentStyle);
CPPUNIT_TEST_SUITE_END();
};
@@ -403,6 +405,24 @@ void Test::testTdf97936()
assertXPath(pDocument, "/primitive2D/transform/polypolygoncolor[2]", "maxx", "60");
assertXPath(pDocument, "/primitive2D/transform/polypolygoncolor[2]", "maxy", "100");
}
+
+void Test::testClipPathAndParentStyle()
+{
+ //Check that fill color, stroke color and stroke-width are inherited from use element
+ //when the element is within a clipPath element
+ Primitive2DSequence aSequenceClipPathAndParentStyle = parseSvg("/svgio/qa/cppunit/data/ClipPathAndParentStyle.svg");
+ CPPUNIT_ASSERT_EQUAL(1, (int)aSequenceClipPathAndParentStyle.getLength());
+
+ Primitive2dXmlDump dumper;
+ xmlDocPtr pDocument = dumper.dumpAndParse(comphelper::sequenceToContainer<Primitive2DContainer>(aSequenceClipPathAndParentStyle));
+
+ CPPUNIT_ASSERT (pDocument);
+
+ assertXPath(pDocument, "/primitive2D/transform/polypolygoncolor", "color", "#ff0000");
+ assertXPath(pDocument, "/primitive2D/transform/polypolygonstroke/line", "color", "#000000");
+ assertXPath(pDocument, "/primitive2D/transform/polypolygonstroke/line", "width", "5");
+
+}
CPPUNIT_TEST_SUITE_REGISTRATION(Test);
}