sw/qa/extras/layout/data/tdf40260.odt |binary sw/qa/extras/layout/layout2.cxx | 18 ++++++++++++++++++ 2 files changed, 18 insertions(+)
New commits: commit a5be4c219af373d038bc034d26c63c67e9803ce8 Author: Xisco Fauli <xiscofa...@libreoffice.org> AuthorDate: Fri Feb 12 09:47:28 2021 +0100 Commit: Xisco Fauli <xiscofa...@libreoffice.org> CommitDate: Fri Feb 12 10:39:36 2021 +0100 tdf#40260: sw_layoutwriter: Add unittest Change-Id: I9e9820c31735703b1fa8583ada74af47534df186 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110799 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> diff --git a/sw/qa/extras/layout/data/tdf40260.odt b/sw/qa/extras/layout/data/tdf40260.odt new file mode 100644 index 000000000000..3a9c23f547cf Binary files /dev/null and b/sw/qa/extras/layout/data/tdf40260.odt differ diff --git a/sw/qa/extras/layout/layout2.cxx b/sw/qa/extras/layout/layout2.cxx index d3c3f247f01a..806da69af6a1 100644 --- a/sw/qa/extras/layout/layout2.cxx +++ b/sw/qa/extras/layout/layout2.cxx @@ -826,6 +826,24 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf130969) pXmlDoc, "/metafile/push[1]/push[1]/push[1]/push[4]/push[1]/textarray[5]/text", "0.35781"); } +CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf40260) +{ + SwDoc* pDoc = createDoc("tdf40260.odt"); + SwDocShell* pShell = pDoc->GetDocShell(); + + std::shared_ptr<GDIMetaFile> xMetaFile = pShell->GetPreviewMetaFile(); + MetafileXmlDump dumper; + xmlDocUniquePtr pXmlDoc = dumpAndParse(dumper, *xMetaFile); + CPPUNIT_ASSERT(pXmlDoc); + + // Without the fix in place, this test would have failed with + // - Expected: f(x) = 1.26510397865547E-06 x − 5.95245604996327E-12 + // - Actual : f(x) = 0 x − 0 + assertXPathContent( + pXmlDoc, "/metafile/push/push/push/push[3]/push/push/push/textarray[19]/text", + "f(x) = 1.26510397865547E-06 x " + OUStringChar(u'\x2212') + " 5.95245604996327E-12"); +} + CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf129054) { SwDoc* pDoc = createDoc("tdf129054.docx"); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits