diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2023-07-03 14:11:43 +0200 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2023-07-03 16:15:13 +0200 |
commit | 13a41e7a12598c7896d6dc8d34aba6af5b80b83c (patch) | |
tree | 84f7451601988be8eb76ac6728cfc92d6ae04dbe /svgio/qa/cppunit | |
parent | ba4aa9e6f0e4947d1e111bdb4c765a6b58307d48 (diff) |
tdf#150124: do nothing when parent is of unkown type
Change-Id: I745b2a81200b0d8138b5f1b844849f20571d9546
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153878
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'svgio/qa/cppunit')
-rw-r--r-- | svgio/qa/cppunit/SvgImportTest.cxx | 14 | ||||
-rw-r--r-- | svgio/qa/cppunit/data/tdf150124.svg | 12 |
2 files changed, 26 insertions, 0 deletions
diff --git a/svgio/qa/cppunit/SvgImportTest.cxx b/svgio/qa/cppunit/SvgImportTest.cxx index 6827d4f81d39..a72bb39b993f 100644 --- a/svgio/qa/cppunit/SvgImportTest.cxx +++ b/svgio/qa/cppunit/SvgImportTest.cxx @@ -135,6 +135,20 @@ CPPUNIT_TEST_FIXTURE(Test, testSymbol) assertXPath(pDocument, "/primitive2D/transform/polypolygoncolor", "color", "#00d000"); } +CPPUNIT_TEST_FIXTURE(Test, testTdf150124) +{ + Primitive2DSequence aSequence = parseSvg(u"/svgio/qa/cppunit/data/tdf150124.svg"); + CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(aSequence.getLength())); + + drawinglayer::Primitive2dXmlDump dumper; + xmlDocUniquePtr pDocument = dumper.dumpAndParse(aSequence); + + CPPUNIT_ASSERT (pDocument); + + assertXPathChildren(pDocument, "/primitive2D", 1); + assertXPath(pDocument, "/primitive2D/hiddengeometry", 1); +} + CPPUNIT_TEST_FIXTURE(Test, testTdf155819) { Primitive2DSequence aSequence = parseSvg(u"/svgio/qa/cppunit/data/tdf155819.svg"); diff --git a/svgio/qa/cppunit/data/tdf150124.svg b/svgio/qa/cppunit/data/tdf150124.svg new file mode 100644 index 000000000000..29b2a1e3fd46 --- /dev/null +++ b/svgio/qa/cppunit/data/tdf150124.svg @@ -0,0 +1,12 @@ +<svg id="svg-root" width="100%" height="100%" + viewBox="0 0 480 360" xmlns="http://www.w3.org/2000/svg" + xmlns:xlink="http://www.w3.org/1999/xlink"> + <invented> + <rect id='r1' x='0' y='0' width='50' height='50' fill='red'/> + <g> + <rect id='r2' x='60' y='0' width='50' height='50' fill='green'/> + </g> + <circle id="myCircle" cx="50" cy="50" r="40" stroke="blue" /> + </invented> + <use href="myCircle" x="20" fill="white" stroke="red" /> +</svg> |