[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - sw/qa
Michael Stahl (via logerrit)
logerrit at kemper.freedesktop.org
Thu Jan 16 19:35:26 UTC 2020
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 739627a524ab32a085c49a8936708ba58de8d393
Author: Michael Stahl <Michael.Stahl at cib.de>
AuthorDate: Tue Dec 17 16:18:45 2019 +0100
Commit: Miklos Vajna <vmiklos at collabora.com>
CommitDate: Thu Jan 16 20:34:40 2020 +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.stahl at cib.de>
Tested-by: Michael Stahl <michael.stahl at cib.de>
(cherry picked from commit 91b2644f3955defc82279beff12d34c9133f57a2)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86914
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
Reviewed-by: Miklos Vajna <vmiklos at collabora.com>
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 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.
More information about the Libreoffice-commits
mailing list