From 04c78e1a46a423071d7ea68724525ec7ef92e0e8 Mon Sep 17 00:00:00 2001 From: Xisco Fauli Date: Wed, 5 Jul 2023 13:31:27 +0200 Subject: tdf#156167: create separate map for case insensitive strings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Change-Id: Ic54dfe45eaff5ef75bcd4ebab715f278540da913 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154055 Tested-by: Xisco Fauli Reviewed-by: Xisco Fauli --- svgio/qa/cppunit/SvgImportTest.cxx | 19 +++++++++++++++++++ svgio/qa/cppunit/data/tdf156167.svg | 18 ++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 svgio/qa/cppunit/data/tdf156167.svg (limited to 'svgio/qa/cppunit') 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(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 @@ + + + + + + + + + + + + + -- cgit