summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2020-05-19 17:34:08 +0200
committerXisco FaulĂ­ <xiscofauli@libreoffice.org>2020-05-19 20:16:06 +0200
commita135eaacd3bf0b6125626e03e73840660bf27bf0 (patch)
treeae40a6f3759b5824cabd563ec34be3f4902fdb05
parent8e572dc82b132de8472928db0ab0aed6388390e8 (diff)
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@libreoffice.org>
-rw-r--r--sw/qa/extras/ooxmlexport/data/tdf118242.odtbin0 -> 30562 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport7.cxx22
2 files changed, 22 insertions, 0 deletions
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
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/tdf118242.odt
Binary files 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.