summaryrefslogtreecommitdiff
path: root/svgio/qa/cppunit
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2023-07-11 16:08:38 +0200
committerXisco Fauli <xiscofauli@libreoffice.org>2023-07-12 06:35:20 +0200
commitf7af4c311ad04ce5e54e08b9d7ccd71b75b7a32d (patch)
tree6efb8ac0c6a0b9b1e7482e9d69c90a6132cdccb7 /svgio/qa/cppunit
parent6f77ed620bbff11a1232b593be97e7d6f29aa8ac (diff)
tdf#156236: For the rx or ry properties, "0" is valid
Change-Id: I32c865e409a339c444440e00ee0f624c45380773 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154307 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'svgio/qa/cppunit')
-rw-r--r--svgio/qa/cppunit/SvgImportTest.cxx20
-rw-r--r--svgio/qa/cppunit/data/tdf156236.svg7
2 files changed, 25 insertions, 2 deletions
diff --git a/svgio/qa/cppunit/SvgImportTest.cxx b/svgio/qa/cppunit/SvgImportTest.cxx
index 0f8b31d4b1cc..9f0b8ff7b9d7 100644
--- a/svgio/qa/cppunit/SvgImportTest.cxx
+++ b/svgio/qa/cppunit/SvgImportTest.cxx
@@ -1048,11 +1048,11 @@ CPPUNIT_TEST_FIXTURE(Test, testClipRule)
// - Actual : 10
assertXPath(pDocument, "/primitive2D/transform/mask[1]/polypolygon/polygon/point", 5);
assertXPath(pDocument, "/primitive2D/transform/mask[1]/polypolygoncolor", "color", "#0000ff");
- assertXPath(pDocument, "/primitive2D/transform/mask[1]/polypolygoncolor/polypolygon/polygon/point", 5);
+ assertXPath(pDocument, "/primitive2D/transform/mask[1]/polypolygoncolor/polypolygon/polygon/point", 4);
assertXPath(pDocument, "/primitive2D/transform/mask[2]/polypolygon/polygon/point", 5);
assertXPath(pDocument, "/primitive2D/transform/mask[2]/polypolygoncolor", "color", "#ff0000");
- assertXPath(pDocument, "/primitive2D/transform/mask[2]/polypolygoncolor/polypolygon/polygon/point", 5);
+ assertXPath(pDocument, "/primitive2D/transform/mask[2]/polypolygoncolor/polypolygon/polygon/point", 4);
}
CPPUNIT_TEST_FIXTURE(Test, testi125329)
@@ -1271,6 +1271,22 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf94765)
assertXPath(pDocument, "/primitive2D/transform/transform/svglineargradient[2]", "endy", "0");
}
+CPPUNIT_TEST_FIXTURE(Test, testTdf156236)
+{
+ Primitive2DSequence aSequenceTdf94765 = parseSvg(u"/svgio/qa/cppunit/data/tdf156236.svg");
+ CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(aSequenceTdf94765.getLength()));
+
+ drawinglayer::Primitive2dXmlDump dumper;
+ xmlDocUniquePtr pDocument = dumper.dumpAndParse(Primitive2DContainer(aSequenceTdf94765));
+
+ CPPUNIT_ASSERT (pDocument);
+
+ assertXPath(pDocument, "/primitive2D/transform/polypolygoncolor[1]/polypolygon", "path", "m50 180h-30v-60h60v60z");
+ assertXPath(pDocument, "/primitive2D/transform/polypolygoncolor[2]/polypolygon", "path", "m150 180h15c8.2842712474619 0 15-6.7157287525381 15-15v-30c0-8.2842712474619-6.7157287525381-15-15-15h-30c-8.2842712474619 0-15 6.7157287525381-15 15v30c0 8.2842712474619 6.7157287525381 15 15 15z");
+ assertXPath(pDocument, "/primitive2D/transform/polypolygoncolor[3]/polypolygon", "path", "m250 180h15c8.2842712474619 0 15-6.7157287525381 15-15v-30c0-8.2842712474619-6.7157287525381-15-15-15h-30c-8.2842712474619 0-15 6.7157287525381-15 15v30c0 8.2842712474619 6.7157287525381 15 15 15z");
+ assertXPath(pDocument, "/primitive2D/transform/polypolygoncolor[4]/polypolygon", "path", "m350 180c16.5685424949238 0 30-6.7157287525381 30-15v-30c0-8.2842712474619-13.4314575050762-15-30-15s-30 6.7157287525381-30 15v30c0 8.2842712474619 13.4314575050762 15 30 15z");
+}
+
CPPUNIT_TEST_FIXTURE(Test, testBehaviourWhenWidthAndHeightIsOrIsNotSet)
{
// This test checks the behaviour when width and height attributes
diff --git a/svgio/qa/cppunit/data/tdf156236.svg b/svgio/qa/cppunit/data/tdf156236.svg
new file mode 100644
index 000000000000..12268652c03b
--- /dev/null
+++ b/svgio/qa/cppunit/data/tdf156236.svg
@@ -0,0 +1,7 @@
+<svg viewBox="0 0 500 200" xmlns="http://www.w3.org/2000/svg">
+ <rect x="20" y="120" width="60" height="60" rx="0" ry="15" />
+ <rect x="120" y="120" width="60" height="60" ry="15" />
+ <rect x="220" y="120" width="60" height="60" rx="-150" ry="15" />
+ <rect x="320" y="120" width="60" height="60" rx="150" ry="15" />
+</svg>
+