summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMichael Stahl <Michael.Stahl@cib.de>2019-12-17 16:18:45 +0100
committerMiklos Vajna <vmiklos@collabora.com>2020-01-16 20:34:40 +0100
commit739627a524ab32a085c49a8936708ba58de8d393 (patch)
tree5cbc8bc5718c38dd5d9b599a42666d173ec2aa2a /sw
parent5d59d1b4344baf2fe276fe6a0bfe9afe782a32e0 (diff)
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.stahl@cib.de> Tested-by: Michael Stahl <michael.stahl@cib.de> (cherry picked from commit 91b2644f3955defc82279beff12d34c9133f57a2) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86914 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/ooxmlexport/data/090716_Studentische_Arbeit_VWS.docxbin0 -> 42368 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport12.cxx45
2 files changed, 45 insertions, 0 deletions
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
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/090716_Studentische_Arbeit_VWS.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx
index a91fe0c3b67b..eb276ab56981 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx
@@ -724,6 +724,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.