sw/qa/extras/ooxmlexport/data/090716_Studentische_Arbeit_VWS.docx |binary sw/qa/extras/ooxmlexport/ooxmlexport12.cxx | 45 ++++++++++ 2 files changed, 45 insertions(+)
New commits: commit afd7dbe634fc6a0d4b2d4860edda205a9b4ef4c7 Author: Michael Stahl <michael.st...@cib.de> AuthorDate: Tue Dec 17 16:18:45 2019 +0100 Commit: Michael Stahl <michael.st...@cib.de> CommitDate: Wed Dec 18 09:43:31 2019 +0100 tdf#112202,tdf#112201 sw: add test Let's check via the layout which headers are used. Change-Id: I9fe30192db609d391921930c0e535daf8062e30a Reviewed-on: https://gerrit.libreoffice.org/85305 Reviewed-by: Michael Stahl <michael.st...@cib.de> Tested-by: Michael Stahl <michael.st...@cib.de> (cherry picked from commit 91b2644f3955defc82279beff12d34c9133f57a2) Reviewed-on: https://gerrit.libreoffice.org/85322 Tested-by: Jenkins diff --git a/sw/qa/extras/ooxmlexport/data/090716_Studentische_Arbeit_VWS.docx b/sw/qa/extras/ooxmlexport/data/090716_Studentische_Arbeit_VWS.docx new file mode 100644 index 000000000000..bfed379195d6 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/090716_Studentische_Arbeit_VWS.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx index c48efcb95cc0..908faf14e22a 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx @@ -674,6 +674,51 @@ DECLARE_OOXMLEXPORT_TEST(testObjectCrossReference, "object_cross_reference.odt") CPPUNIT_ASSERT_EQUAL(sal_uInt16(21), nIndex); } +DECLARE_OOXMLEXPORT_TEST(testTdf112202, "090716_Studentische_Arbeit_VWS.docx") +{ + xmlDocPtr pXmlDoc = parseLayoutDump(); + + // page 1 header: 1 paragraph, 2 flys, 1 draw object + assertXPath(pXmlDoc, "/root/page[1]/header/txt", 1); + assertXPath(pXmlDoc, "/root/page[1]/header/txt/anchored/fly", 2); + if (mbExported) // somehow there's an additional shape on re-import? + assertXPath(pXmlDoc, "/root/page[1]/header/txt/anchored/SwAnchoredDrawObject", 2); + else + assertXPath(pXmlDoc, "/root/page[1]/header/txt/anchored/SwAnchoredDrawObject", 1); + + // page 2 header: 3 paragraphs, 1 table, 1 fly on last paragraph + assertXPath(pXmlDoc, "/root/page[2]/header/txt", 3); + assertXPath(pXmlDoc, "/root/page[2]/header/tab", 1); + assertXPath(pXmlDoc, "/root/page[2]/header/txt/anchored/fly", 1); + + // page 3 header: 1 table, 1 paragraph, no text + assertXPath(pXmlDoc, "/root/page[3]/header/txt", 1); + assertXPath(pXmlDoc, "/root/page[3]/header/tab", 1); + assertXPath(pXmlDoc, "/root/page[3]/header/tab/row/cell/txt/Text", 0); + assertXPath(pXmlDoc, "/root/page[3]/header//anchored", 0); + + // page 4 header: 1 table, 1 paragraph, with text + assertXPath(pXmlDoc, "/root/page[4]/header/txt", 1); + assertXPath(pXmlDoc, "/root/page[4]/header/tab", 1); + assertXPath(pXmlDoc, "/root/page[4]/header/tab/row[1]/cell[1]/txt[1]/Text", "Portion", + "Titel der studentischen Arbeit"); + assertXPath(pXmlDoc, "/root/page[4]/header//anchored", 0); + + // page 5: same as page 4 + assertXPath(pXmlDoc, "/root/page[5]/header/txt", 1); + assertXPath(pXmlDoc, "/root/page[5]/header/tab", 1); + assertXPath(pXmlDoc, "/root/page[5]/header/tab/row[1]/cell[1]/txt[1]/Text", "Portion", + "Titel der studentischen Arbeit"); + assertXPath(pXmlDoc, "/root/page[5]/header//anchored", 0); + + // page 6: same as page 4 + assertXPath(pXmlDoc, "/root/page[6]/header/txt", 1); + assertXPath(pXmlDoc, "/root/page[6]/header/tab", 1); + assertXPath(pXmlDoc, "/root/page[6]/header/tab/row[1]/cell[1]/txt[1]/Text", "Portion", + "Titel der studentischen Arbeit"); + assertXPath(pXmlDoc, "/root/page[6]/header//anchored", 0); +} + DECLARE_OOXMLEXPORT_TEST(testTdf79435_legacyInputFields, "tdf79435_legacyInputFields.doc") { //using .doc input file to verify cross-format compatibility. _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits