summaryrefslogtreecommitdiff
path: root/svgio/qa
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2023-07-05 13:31:27 +0200
committerXisco Fauli <xiscofauli@libreoffice.org>2023-07-06 14:36:44 +0200
commit04c78e1a46a423071d7ea68724525ec7ef92e0e8 (patch)
tree44d6392b16903911b1a763d64bb8cd4964c433a2 /svgio/qa
parentaf34f4ea62d8aabbab5d4028034aa2482c16fe8a (diff)
tdf#156167: create separate map for case insensitive strings
Add static_assert to make sure both maps have the same size Regression from: svgio: use "frozen" for mapping between token strings and enums Change-Id: I2061606146cfcb34169dccf69b6f720727839d04 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153174 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> Change-Id: Ic54dfe45eaff5ef75bcd4ebab715f278540da913 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154055 Tested-by: Xisco Fauli <xiscofauli@libreoffice.org> Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'svgio/qa')
-rw-r--r--svgio/qa/cppunit/SvgImportTest.cxx19
-rw-r--r--svgio/qa/cppunit/data/tdf156167.svg18
2 files changed, 37 insertions, 0 deletions
diff --git a/svgio/qa/cppunit/SvgImportTest.cxx b/svgio/qa/cppunit/SvgImportTest.cxx
index 788eab52fdf5..24f146592249 100644
--- a/svgio/qa/cppunit/SvgImportTest.cxx
+++ b/svgio/qa/cppunit/SvgImportTest.cxx
@@ -505,6 +505,25 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf156018)
assertXPath(pDocument, "/primitive2D/transform/polypolygoncolor[2]", "color", "#0000ff");
}
+CPPUNIT_TEST_FIXTURE(Test, testTdf156167)
+{
+ Primitive2DSequence aSequence = parseSvg(u"/svgio/qa/cppunit/data/tdf156167.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/polypolygoncolor[1]", "color", "#ffa500");
+
+ // Without the fix in place, this test would have failed with
+ // - Expected: #ffa500
+ // - Actual : #ff0000
+ assertXPath(pDocument, "/primitive2D/transform/polypolygoncolor[2]", "color", "#ffa500");
+ assertXPath(pDocument, "/primitive2D/transform/polypolygoncolor[3]", "color", "#ffa500");
+}
+
CPPUNIT_TEST_FIXTURE(Test, testTdf155932)
{
Primitive2DSequence aSequence = parseSvg(u"/svgio/qa/cppunit/data/tdf155932.svg");
diff --git a/svgio/qa/cppunit/data/tdf156167.svg b/svgio/qa/cppunit/data/tdf156167.svg
new file mode 100644
index 000000000000..5ab1254013c4
--- /dev/null
+++ b/svgio/qa/cppunit/data/tdf156167.svg
@@ -0,0 +1,18 @@
+<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">
+ <g id="test-body-content" font-family="SVGFreeSansASCII,sans-serif" font-size="18">
+
+ <g fill="orange">
+ <circle id="a" FiLl="red" cx="140" cy="100" r="50"/>
+ </g>
+ <circle id="b" fill="red" style="FiLl: oRaNgE" cx="340" cy="100" r="50"/>
+ <circle id="c" fill="blue" cx="140" cy="220" r="50"/>
+
+ <style type="text/css">
+ #c {fill: red }
+ #c {FiLl: oRaNgE }
+ </style>
+
+ </g>
+</svg>