[Libreoffice-commits] core.git: sw/qa

Xisco Fauli (via logerrit) logerrit at kemper.freedesktop.org
Tue May 19 18:16:39 UTC 2020


 sw/qa/extras/ooxmlexport/data/tdf118242.odt |binary
 sw/qa/extras/ooxmlexport/ooxmlexport7.cxx   |   22 ++++++++++++++++++++++
 2 files changed, 22 insertions(+)

New commits:
commit a135eaacd3bf0b6125626e03e73840660bf27bf0
Author:     Xisco Fauli <xiscofauli at libreoffice.org>
AuthorDate: Tue May 19 17:34:08 2020 +0200
Commit:     Xisco Faulí <xiscofauli at libreoffice.org>
CommitDate: Tue May 19 20:16:06 2020 +0200

    tdf#118242: sw: Add unittest
    
    Change-Id: Ie2ade3ce50049dec3e91a8bf29400c302d564aeb
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94540
    Tested-by: Jenkins
    Reviewed-by: Xisco Faulí <xiscofauli at libreoffice.org>

diff --git a/sw/qa/extras/ooxmlexport/data/tdf118242.odt b/sw/qa/extras/ooxmlexport/data/tdf118242.odt
new file mode 100644
index 000000000000..14b468d75047
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf118242.odt differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport7.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport7.cxx
index bb961d13defe..71696adeb6be 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport7.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport7.cxx
@@ -887,6 +887,28 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo80895, "fdo80895.docx")
     assertXPath(pXmlDoc, "/w:hdr/w:p/w:r/mc:AlternateContent/mc:Fallback/w:pict/v:rect/v:fill", "type", "solid");
 }
 
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf118242, "tdf118242.odt")
+{
+    xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml");
+
+    assertXPath(pXmlDocument, "/w:document/w:body/w:p[1]/w:r[2]/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor"
+    "/a:graphic/a:graphicData/wps:wsp/wps:txbx/w:txbxContent/w:p[2]/w:pPr/w:pStyle", "val", "HeaderRight");
+
+    // w:sectPr is not exported
+    assertXPath(pXmlDocument, "/w:document/w:body/w:p[1]/w:r[2]/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor"
+    "/a:graphic/a:graphicData/wps:wsp/wps:txbx/w:txbxContent/w:p[2]/w:pPr/w:sectPr", 0);
+
+    // and drawing is no longer in the document
+    assertXPath(pXmlDocument, "/w:document/w:body/w:p[1]/w:r[3]", 0);
+
+    //but it's in the header
+    pXmlDocument = parseExport("word/header1.xml");
+
+    assertXPath(pXmlDocument, "/w:hdr/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData"
+            "/wps:wsp/wps:txbx/w:txbxContent/w:p[1]/w:r/w:drawing", 1);
+
+}
+
 DECLARE_OOXMLEXPORT_TEST(testWrapTightThrough, "wrap-tight-through.docx")
 {
     // These were wrapSquare without a wrap polygon before.


More information about the Libreoffice-commits mailing list