diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2023-08-01 18:19:20 +0200 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2023-08-03 10:04:47 +0200 |
commit | 879511812741be3564f00406da6c1e722180f155 (patch) | |
tree | d031dd4058267c2bae26481606df00ad4f1dd1d3 /svgio/qa/cppunit/SvgImportTest.cxx | |
parent | b4ebb3159e00087ac94cd3494da22a5fa4c3e38f (diff) |
tdf#156283: take remaing dx value into consideration too
Change-Id: I27c6f12edacd68c7f956b67dcf9ef0cc5045e3d1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155169
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155212
Diffstat (limited to 'svgio/qa/cppunit/SvgImportTest.cxx')
-rw-r--r-- | svgio/qa/cppunit/SvgImportTest.cxx | 36 |
1 files changed, 35 insertions, 1 deletions
diff --git a/svgio/qa/cppunit/SvgImportTest.cxx b/svgio/qa/cppunit/SvgImportTest.cxx index ea327dfa0011..17736515010a 100644 --- a/svgio/qa/cppunit/SvgImportTest.cxx +++ b/svgio/qa/cppunit/SvgImportTest.cxx @@ -1427,6 +1427,39 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf156269) assertXPath(pDocument, "//textsimpleportion[@text='two']", "fontcolor", "#000000"); } +CPPUNIT_TEST_FIXTURE(Test, testTdf156283) +{ + Primitive2DSequence aSequence = parseSvg(u"/svgio/qa/cppunit/data/tdf156283.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/textsimpleportion[1]", "width", "16"); + assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[1]", "height", "16"); + assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[1]", "x", "30"); + assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[1]", "y", "20"); + assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[1]", "text", "ABC"); + assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[1]", "dx0", "41"); + assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[1]", "dx1", "52"); + assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[1]", "dx2", "63"); + + assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[2]", "width", "16"); + assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[2]", "height", "16"); + assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[2]", "x", "30"); + assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[2]", "y", "30"); + assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[2]", "text", "ABC"); + + // Without the fix in place, this test would have failed with + // - Expected: 41 + // - Actual : 12 + assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[2]", "dx0", "41"); + assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[2]", "dx1", "52"); + assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[2]", "dx2", "63"); +} + CPPUNIT_TEST_FIXTURE(Test, testTdf156271) { Primitive2DSequence aSequence = parseSvg(u"/svgio/qa/cppunit/data/tdf156271.svg"); @@ -1470,7 +1503,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf156271) assertXPath(pDocument, "/primitive2D/transform/mask/textsimpleportion[4]", "x", "40"); assertXPath(pDocument, "/primitive2D/transform/mask/textsimpleportion[4]", "y", "40"); assertXPath(pDocument, "/primitive2D/transform/mask/textsimpleportion[4]", "text", "AB"); - assertXPathNoAttribute(pDocument, "/primitive2D/transform/mask/textsimpleportion[4]", "dx0"); + assertXPath(pDocument, "/primitive2D/transform/mask/textsimpleportion[4]", "dx0", "12"); + assertXPath(pDocument, "/primitive2D/transform/mask/textsimpleportion[4]", "dx1", "23"); } CPPUNIT_TEST_FIXTURE(Test, testTdf149880) |