[Libreoffice-commits] core.git: svgio/qa
Xisco Fauli (via logerrit)
logerrit at kemper.freedesktop.org
Mon Sep 23 06:11:06 UTC 2019
svgio/qa/cppunit/SvgImportTest.cxx | 18 ++++++++++++++++++
svgio/qa/cppunit/data/noneColor.svg | 3 +++
2 files changed, 21 insertions(+)
New commits:
commit 3fbccd6820855123a11009f963cfe37cf133e678
Author: Xisco Fauli <xiscofauli at libreoffice.org>
AuthorDate: Mon Sep 23 02:24:58 2019 +0200
Commit: Xisco FaulĂ <xiscofauli at libreoffice.org>
CommitDate: Mon Sep 23 08:10:24 2019 +0200
SVGIO: add unittest for fill:none
Change-Id: I218a0d24222ae3d91c4e6dbd7a619f36823752ee
Reviewed-on: https://gerrit.libreoffice.org/79370
Tested-by: Jenkins
Reviewed-by: Xisco FaulĂ <xiscofauli at libreoffice.org>
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>
More information about the Libreoffice-commits
mailing list