From 1df7a1ac274db509f1a135b84a01ea51c4d0c1f9 Mon Sep 17 00:00:00 2001 From: Xisco Fauli Date: Thu, 13 Jul 2023 11:14:25 +0200 Subject: tdf#156269: dx and dy do not depend on x and y Change-Id: I99be5aa45b333ec3825373c3a10be0e24d23cb29 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154380 Tested-by: Jenkins Reviewed-by: Xisco Fauli --- svgio/qa/cppunit/SvgImportTest.cxx | 27 +++++++++++++++++++++++++++ svgio/qa/cppunit/data/tdf156269.svg | 8 ++++++++ 2 files changed, 35 insertions(+) create mode 100644 svgio/qa/cppunit/data/tdf156269.svg (limited to 'svgio/qa') diff --git a/svgio/qa/cppunit/SvgImportTest.cxx b/svgio/qa/cppunit/SvgImportTest.cxx index b3d20603cfa7..7263439e86c1 100644 --- a/svgio/qa/cppunit/SvgImportTest.cxx +++ b/svgio/qa/cppunit/SvgImportTest.cxx @@ -1404,6 +1404,33 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf97663) assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[2]", "y", "236"); } +CPPUNIT_TEST_FIXTURE(Test, testTdf156269) +{ + Primitive2DSequence aSequence = parseSvg(u"/svgio/qa/cppunit/data/tdf156269.svg"); + CPPUNIT_ASSERT_EQUAL(1, static_cast(aSequence.getLength())); + + drawinglayer::Primitive2dXmlDump dumper; + xmlDocUniquePtr pDocument = dumper.dumpAndParse(Primitive2DContainer(aSequence)); + + CPPUNIT_ASSERT (pDocument); + + assertXPath(pDocument, "//textsimpleportion[@text='one']", "width", "16"); + assertXPath(pDocument, "//textsimpleportion[@text='one']", "height", "16"); + assertXPath(pDocument, "//textsimpleportion[@text='one']", "x", "10"); + assertXPath(pDocument, "//textsimpleportion[@text='one']", "y", "50"); + assertXPath(pDocument, "//textsimpleportion[@text='one']", "fontcolor", "#808080"); + + assertXPath(pDocument, "//textsimpleportion[@text='two']", "width", "16"); + assertXPath(pDocument, "//textsimpleportion[@text='two']", "height", "16"); + + // Without the fix in place, this test would have failed with + // - Expected: 60 + // - Actual : 10 + assertXPath(pDocument, "//textsimpleportion[@text='two']", "x", "60"); + assertXPath(pDocument, "//textsimpleportion[@text='two']", "y", "100"); + assertXPath(pDocument, "//textsimpleportion[@text='two']", "fontcolor", "#000000"); +} + CPPUNIT_TEST_FIXTURE(Test, testTdf149880) { Primitive2DSequence aSequence = parseSvg(u"/svgio/qa/cppunit/data/tdf149880.svg"); diff --git a/svgio/qa/cppunit/data/tdf156269.svg b/svgio/qa/cppunit/data/tdf156269.svg new file mode 100644 index 000000000000..e840b351d17d --- /dev/null +++ b/svgio/qa/cppunit/data/tdf156269.svg @@ -0,0 +1,8 @@ + + + one + + + two + + -- cgit