summaryrefslogtreecommitdiff
path: root/svgio
diff options
context:
space:
mode:
authorXisco Fauli <anistenis@gmail.com>2016-04-08 17:17:10 +0200
committerXisco FaulĂ­ <anistenis@gmail.com>2016-04-12 17:23:00 +0000
commit93cf43de1bb28929e8b8fbed7f32693c62026e67 (patch)
tree511f16fbba0a246fe570acd15f484f230d1f5df7 /svgio
parentc108fbe0a31cf74a171351e297f4987f2f4a2862 (diff)
SVG: Add unittest for #i125329#
Change-Id: I2d6fbd81c8d95283cf8937739e338ddac14d8df0 Reviewed-on: https://gerrit.libreoffice.org/24008 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Xisco FaulĂ­ <anistenis@gmail.com>
Diffstat (limited to 'svgio')
-rw-r--r--svgio/qa/cppunit/SvgImportTest.cxx26
-rw-r--r--svgio/qa/cppunit/data/i125329.svg12
2 files changed, 38 insertions, 0 deletions
diff --git a/svgio/qa/cppunit/SvgImportTest.cxx b/svgio/qa/cppunit/SvgImportTest.cxx
index bf61830eae99..be3b10292f90 100644
--- a/svgio/qa/cppunit/SvgImportTest.cxx
+++ b/svgio/qa/cppunit/SvgImportTest.cxx
@@ -55,6 +55,7 @@ class Test : public test::BootstrapFixture, public XmlTestTools
void testTdf97936();
void testClipPathAndParentStyle();
void testClipPathAndStyle();
+ void testi125329();
Primitive2DSequence parseSvg(const char* aSource);
@@ -80,6 +81,7 @@ public:
CPPUNIT_TEST(testTdf97936);
CPPUNIT_TEST(testClipPathAndParentStyle);
CPPUNIT_TEST(testClipPathAndStyle);
+ CPPUNIT_TEST(testi125329);
CPPUNIT_TEST_SUITE_END();
};
@@ -444,6 +446,30 @@ void Test::testClipPathAndStyle()
}
+void Test::testi125329()
+{
+ //Check style inherit from * css element
+ Primitive2DSequence aSequencei125329 = parseSvg("/svgio/qa/cppunit/data/i125329.svg");
+ CPPUNIT_ASSERT_EQUAL(1, (int)aSequencei125329.getLength());
+
+ Primitive2dXmlDump dumper;
+ xmlDocPtr pDocument = dumper.dumpAndParse(comphelper::sequenceToContainer<Primitive2DContainer>(aSequencei125329));
+
+ CPPUNIT_ASSERT (pDocument);
+
+ assertXPath(pDocument, "/primitive2D/transform/transform/polypolygoncolor", "color", "#c0c0c0"); // rect background color
+ assertXPath(pDocument, "/primitive2D/transform/transform/polypolygoncolor", "height", "30"); // rect background height
+ assertXPath(pDocument, "/primitive2D/transform/transform/polypolygoncolor", "width", "50"); // rect background width
+ assertXPath(pDocument, "/primitive2D/transform/transform/polypolygoncolor", "minx", "15");
+ assertXPath(pDocument, "/primitive2D/transform/transform/polypolygoncolor", "miny", "15");
+ assertXPath(pDocument, "/primitive2D/transform/transform/polypolygoncolor", "maxx", "65");
+ assertXPath(pDocument, "/primitive2D/transform/transform/polypolygoncolor", "maxy", "45");
+ assertXPath(pDocument, "/primitive2D/transform/transform/polypolygonstroke/line", "color", "#008000"); // rect stroke color
+ assertXPath(pDocument, "/primitive2D/transform/transform/polypolygonstroke/line", "width", "1"); // rect stroke width
+
+
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(Test);
}
diff --git a/svgio/qa/cppunit/data/i125329.svg b/svgio/qa/cppunit/data/i125329.svg
new file mode 100644
index 000000000000..86e3bd8393a2
--- /dev/null
+++ b/svgio/qa/cppunit/data/i125329.svg
@@ -0,0 +1,12 @@
+<svg version="1.1" baseProfile="full" id="svg-root"
+ width="12cm" height="6cm" viewBox="0 0 120 60"
+ xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+
+ <title id="test-title">all selector</title>
+ <style type="text/css">
+ * {fill:silver; stroke-width:1;stroke-miterlimit:100000;}
+ rect {stroke:green;}
+ #test-frame {stroke:blue; fill:none;}
+ </style>
+ <rect x="15" y="15" width="50" height="30" stroke-width="10"/>
+</svg>