summaryrefslogtreecommitdiff
path: root/svgio
diff options
context:
space:
mode:
Diffstat (limited to 'svgio')
-rw-r--r--svgio/qa/cppunit/SvgImportTest.cxx21
-rw-r--r--svgio/qa/cppunit/data/tdf117920.svg7
-rw-r--r--svgio/source/svgreader/svgdocumenthandler.cxx7
3 files changed, 29 insertions, 6 deletions
diff --git a/svgio/qa/cppunit/SvgImportTest.cxx b/svgio/qa/cppunit/SvgImportTest.cxx
index 31e5bdb3ef13..2297367ee778 100644
--- a/svgio/qa/cppunit/SvgImportTest.cxx
+++ b/svgio/qa/cppunit/SvgImportTest.cxx
@@ -991,6 +991,27 @@ CPPUNIT_TEST_FIXTURE(Test, testNoneColor)
assertXPath(pDocument, "/primitive2D/transform/mask/polypolygonstroke/line", "width", "3");
}
+CPPUNIT_TEST_FIXTURE(Test, testTdf117920)
+{
+ Primitive2DSequence aSequence = parseSvg(u"/svgio/qa/cppunit/data/tdf117920.svg");
+ CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(aSequence.getLength()));
+
+ drawinglayer::Primitive2dXmlDump dumper;
+ xmlDocUniquePtr pDocument = dumper.dumpAndParse(Primitive2DContainer(aSequence));
+
+ CPPUNIT_ASSERT (pDocument);
+
+ assertXPath(pDocument, "/primitive2D/transform/transform", "xy11", "1");
+ assertXPath(pDocument, "/primitive2D/transform/transform", "xy12", "0");
+ assertXPath(pDocument, "/primitive2D/transform/transform", "xy13", "-18");
+ assertXPath(pDocument, "/primitive2D/transform/transform", "xy21", "0");
+ assertXPath(pDocument, "/primitive2D/transform/transform", "xy22", "1");
+ assertXPath(pDocument, "/primitive2D/transform/transform", "xy23", "-6");
+ assertXPath(pDocument, "/primitive2D/transform/transform", "xy31", "0");
+ assertXPath(pDocument, "/primitive2D/transform/transform", "xy32", "0");
+ assertXPath(pDocument, "/primitive2D/transform/transform", "xy33", "1");
+}
+
CPPUNIT_TEST_FIXTURE(Test, testTdf97936)
{
// check that both rectangles are rendered in the viewBox
diff --git a/svgio/qa/cppunit/data/tdf117920.svg b/svgio/qa/cppunit/data/tdf117920.svg
new file mode 100644
index 000000000000..487e0f6cb925
--- /dev/null
+++ b/svgio/qa/cppunit/data/tdf117920.svg
@@ -0,0 +1,7 @@
+<svg width="100%" height="100%" viewBox="0 0 100 100"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink">
+ <switch transform="translate(-18,-6)">
+ <rect width="13" height="13" x="18" y="6" />
+ </switch>
+</svg>
diff --git a/svgio/source/svgreader/svgdocumenthandler.cxx b/svgio/source/svgreader/svgdocumenthandler.cxx
index 0b66a4bb44da..9c8ab88f2f62 100644
--- a/svgio/source/svgreader/svgdocumenthandler.cxx
+++ b/svgio/source/svgreader/svgdocumenthandler.cxx
@@ -199,6 +199,7 @@ namespace
mpTarget->parseAttributes(xAttribs);
break;
}
+ case SVGToken::Switch: //TODO: Support switch element
case SVGToken::Defs:
case SVGToken::G:
{
@@ -442,12 +443,6 @@ namespace
break;
}
- case SVGToken::Switch:
- {
- //TODO: Support switch element
- break;
- }
-
default:
{
mpTarget = new SvgNode(SVGToken::Unknown, maDocument, mpTarget);