summaryrefslogtreecommitdiff
path: root/svgio/qa
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2019-09-23 02:24:58 +0200
committerXisco Faulí <xiscofauli@libreoffice.org>2019-09-23 08:10:24 +0200
commit3fbccd6820855123a11009f963cfe37cf133e678 (patch)
treebe02b4473761948c7b14ff6306f260712982f8d0 /svgio/qa
parent97bcd0e416b1fb725b5aaade811e80d46fdaf1e2 (diff)
SVGIO: add unittest for fill:none
Change-Id: I218a0d24222ae3d91c4e6dbd7a619f36823752ee Reviewed-on: https://gerrit.libreoffice.org/79370 Tested-by: Jenkins Reviewed-by: Xisco Faulí <xiscofauli@libreoffice.org>
Diffstat (limited to 'svgio/qa')
-rw-r--r--svgio/qa/cppunit/SvgImportTest.cxx18
-rw-r--r--svgio/qa/cppunit/data/noneColor.svg3
2 files changed, 21 insertions, 0 deletions
diff --git a/svgio/qa/cppunit/SvgImportTest.cxx b/svgio/qa/cppunit/SvgImportTest.cxx
index aee83b05d440..c3605a16e09f 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 testTdf97543();
void testRGBColor();
void testRGBAColor();
+ void testNoneColor();
void testTdf97936();
void testClipPathAndParentStyle();
void testClipPathAndStyle();
@@ -88,6 +89,7 @@ public:
CPPUNIT_TEST(testTdf97543);
CPPUNIT_TEST(testRGBColor);
CPPUNIT_TEST(testRGBAColor);
+ CPPUNIT_TEST(testNoneColor);
CPPUNIT_TEST(testTdf97936);
CPPUNIT_TEST(testClipPathAndParentStyle);
CPPUNIT_TEST(testClipPathAndStyle);
@@ -465,6 +467,22 @@ void Test::testRGBAColor()
assertXPath(pDocument, "/primitive2D/transform/unifiedtransparence", "transparence", "0.5");
}
+void Test::testNoneColor()
+{
+ Primitive2DSequence aSequenceRGBAColor = parseSvg("/svgio/qa/cppunit/data/noneColor.svg");
+ CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(aSequenceRGBAColor.getLength()));
+
+ drawinglayer::tools::Primitive2dXmlDump dumper;
+ xmlDocPtr pDocument = dumper.dumpAndParse(comphelper::sequenceToContainer<Primitive2DContainer>(aSequenceRGBAColor));
+
+ CPPUNIT_ASSERT (pDocument);
+
+ //No polypolygoncolor exists
+ assertXPath(pDocument, "/primitive2D/transform/mask/polypolygoncolor", 0);
+ assertXPath(pDocument, "/primitive2D/transform/mask/polypolygonstroke/line", "color", "#000000");
+ assertXPath(pDocument, "/primitive2D/transform/mask/polypolygonstroke/line", "width", "3");
+}
+
void Test::testTdf97936()
{
// check that both rectangles are rendered in the viewBox
diff --git a/svgio/qa/cppunit/data/noneColor.svg b/svgio/qa/cppunit/data/noneColor.svg
new file mode 100644
index 000000000000..552a1cf5afaf
--- /dev/null
+++ b/svgio/qa/cppunit/data/noneColor.svg
@@ -0,0 +1,3 @@
+<svg width="400" height="110">
+ <rect width="300" height="100" style="fill:none;stroke-width:3;stroke:rgb(0,0,0)" />
+</svg>