diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2021-02-12 09:47:28 +0100 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2021-02-12 10:39:36 +0100 |
commit | a5be4c219af373d038bc034d26c63c67e9803ce8 (patch) | |
tree | cf485f721cef938873ec119a5661df26fd0cfb98 /sw/qa | |
parent | af94ae7e2b28c370b8f16ef5c61708baabd2e842 (diff) |
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 <xiscofauli@libreoffice.org>
Diffstat (limited to 'sw/qa')
-rw-r--r-- | sw/qa/extras/layout/data/tdf40260.odt | bin | 0 -> 17192 bytes | |||
-rw-r--r-- | sw/qa/extras/layout/layout2.cxx | 18 |
2 files changed, 18 insertions, 0 deletions
diff --git a/sw/qa/extras/layout/data/tdf40260.odt b/sw/qa/extras/layout/data/tdf40260.odt Binary files differnew file mode 100644 index 000000000000..3a9c23f547cf --- /dev/null +++ b/sw/qa/extras/layout/data/tdf40260.odt 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"); |