diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2023-06-14 01:10:50 +0200 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2023-06-14 08:08:28 +0200 |
commit | d3f0a59f3c47095d4b1d8c01b1316a7dc7f5467d (patch) | |
tree | 319cb7ec55e769741e80005f5e6f0e2f215449fe /svgio/qa | |
parent | a2eb4bcf2363c13af81e4c53710c2703158130bf (diff) |
tdf#155819: check marker property comes from a style sheet
Since 242b7d0162d55be0945ca849c3de841fbf6cb475
"svgio: simplify code" where bIsInStyleSheet was replaced by
getCssStyleParent() incorrectly
Change-Id: I48632e9374f4615e32d18a141aeabec2936e6ec8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153031
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'svgio/qa')
-rw-r--r-- | svgio/qa/cppunit/SvgImportTest.cxx | 18 | ||||
-rw-r--r-- | svgio/qa/cppunit/data/tdf155819.svg | 15 |
2 files changed, 33 insertions, 0 deletions
diff --git a/svgio/qa/cppunit/SvgImportTest.cxx b/svgio/qa/cppunit/SvgImportTest.cxx index ad5852127551..559af49af695 100644 --- a/svgio/qa/cppunit/SvgImportTest.cxx +++ b/svgio/qa/cppunit/SvgImportTest.cxx @@ -135,6 +135,24 @@ CPPUNIT_TEST_FIXTURE(Test, testSymbol) assertXPath(pDocument, "/primitive2D/transform/polypolygoncolor", "color", "#00d000"); } +CPPUNIT_TEST_FIXTURE(Test, testTdf155819) +{ + Primitive2DSequence aSequence = parseSvg(u"/svgio/qa/cppunit/data/tdf155819.svg"); + CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(aSequence.getLength())); + + drawinglayer::Primitive2dXmlDump dumper; + xmlDocUniquePtr pDocument = dumper.dumpAndParse(aSequence); + + CPPUNIT_ASSERT (pDocument); + + assertXPath(pDocument, "/primitive2D/transform/polypolygonstroke/line", 1); + assertXPath(pDocument, "/primitive2D/transform/polypolygonstroke/polypolygon", 1); + // Without the fix in place, this test would have failed with + // - Expected: 4 + // - Actual : 0 + assertXPath(pDocument, "/primitive2D/transform/transform", 4); +} + CPPUNIT_TEST_FIXTURE(Test, testFilterLuminanceToAlpha) { Primitive2DSequence aSequenceTdf132246 = parseSvg(u"/svgio/qa/cppunit/data/filterLuminanceToAlpha.svg"); diff --git a/svgio/qa/cppunit/data/tdf155819.svg b/svgio/qa/cppunit/data/tdf155819.svg new file mode 100644 index 000000000000..30c2da4d1a5a --- /dev/null +++ b/svgio/qa/cppunit/data/tdf155819.svg @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="UTF-8"?> +<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"> + <style> + path { + fill: none; + stroke-width: 4px; + marker: url(#diamond); + } + </style> + <path d="M 10,50 v -20 h 40 v -20" stroke="red"/> + <marker id="diamond" markerWidth="12" markerHeight="12" refX="6" refY="6" markerUnits="userSpaceOnUse"> + <circle cx="6" cy="6" r="3" + fill="white" stroke="context-stroke" stroke-width="2"/> + </marker> +</svg> |