summaryrefslogtreecommitdiff
path: root/sw/qa
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2019-11-19 22:41:52 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2019-11-19 22:18:27 +0100
commitb0e7e494b6bc69d3833c0a6c256ff8106a4a24cb (patch)
treeab7509c5ef73fc450498e252c6bcb7f2aaac39b9 /sw/qa
parent03fe7f500f2ccfa5e6a41ad1c9b6b1d7d4403887 (diff)
tdf#128889: don't write "page break after" into w:pPr
This produced invalid OOXML, which Word considers as "page before", and LibreOffice ignores when re-importing. Make sure to write it as *trailing* w:r with w:br, as Word also does when imports ODT with this atribute, and saves as DOCX. Change-Id: Ifc4f45d65d4455ecb5cd62aed1ef6a03375c8aa4 Reviewed-on: https://gerrit.libreoffice.org/83232 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sw/qa')
-rw-r--r--sw/qa/extras/ooxmlexport/data/tdf128889.fodt15
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport14.cxx11
2 files changed, 26 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/tdf128889.fodt b/sw/qa/extras/ooxmlexport/data/tdf128889.fodt
new file mode 100644
index 000000000000..6dc1c4202696
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/tdf128889.fodt
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<office:document xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" office:version="1.2" office:mimetype="application/vnd.oasis.opendocument.text">
+ <office:automatic-styles>
+ <style:style style:name="P1" style:family="paragraph" style:parent-style-name="Standard">
+ <style:paragraph-properties fo:break-after="page"/>
+ </style:style>
+ </office:automatic-styles>
+ <office:body>
+ <office:text>
+ <text:p text:style-name="P1">para1</text:p>
+ <text:p>para2</text:p>
+ </office:text>
+ </office:body>
+</office:document> \ No newline at end of file
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx
index 8996ba0edad7..3bafcab32d6b 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx
@@ -168,6 +168,17 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf128820, "tdf128820.fodt")
"a:graphic/a:graphicData/wpg:wgp/wps:wsp");
}
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf128889, "tdf128889.fodt")
+{
+ xmlDocPtr pXml = parseExport("word/document.xml");
+ CPPUNIT_ASSERT(pXml);
+ // There was an w:r (with w:br) as an invalid child of first paragraph's w:pPr
+ assertXPath(pXml, "/w:document/w:body/w:p[1]/w:pPr/w:r", 0);
+ assertXPath(pXml, "/w:document/w:body/w:p[1]/w:r", 2);
+ // Check that the break is in proper - last - position
+ assertXPath(pXml, "/w:document/w:body/w:p[1]/w:r[2]/w:br", "type", "page");
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */