summaryrefslogtreecommitdiff
path: root/sw/qa
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2018-03-05 22:09:39 +0100
committerMichael Meeks <michael.meeks@collabora.com>2018-03-15 16:49:57 +0100
commit0edb7585c7bdf5f01dcf31f106477c959f107a84 (patch)
tree6694af2f65f0ee68cb287fddf86e7b50b59f86e5 /sw/qa
parent15443038c4b8d4c1e7d1aa32df72f41ba93b5b8b (diff)
tdf#115861 DOCX import: avoid last-paragraph removal when discarding footer
Discarding header/footer is necessary when the document or section settings request to ignore first or even headers/footers. In the bugdoc case settings.xml didn't opt-in for different even/odd footers, but there was an even footer to be ignored. Handle this state at two more places, so we don't end up in a situation where we ignore the footer but not its "remove last (empty) paragraph at the end of the footer" action. Also make the debug dumper for text ranges more robust to have a working token dump when we try to get the string for a table. (cherry picked from commit 49cf733effc56c09c5e2eb023120c2d3532b5b3d) Change-Id: I6395f37aa40c42304e2c918d87dadecb21e9d378 Reviewed-on: https://gerrit.libreoffice.org/50884 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Diffstat (limited to 'sw/qa')
-rw-r--r--sw/qa/extras/ooxmlexport/data/tdf115861.docxbin0 -> 15035 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport11.cxx7
2 files changed, 7 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/tdf115861.docx b/sw/qa/extras/ooxmlexport/data/tdf115861.docx
new file mode 100644
index 000000000000..f42a7bad2cfa
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/tdf115861.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx
index 0fd64733e700..35bf52ee25af 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx
@@ -81,6 +81,13 @@ DECLARE_OOXMLEXPORT_TEST(testTdf112694, "tdf112694.docx")
CPPUNIT_ASSERT(!getProperty<bool>(aPageStyle, "HeaderIsOn"));
}
+DECLARE_OOXMLEXPORT_TEST(testTdf115861, "tdf115861.docx")
+{
+ // Second item in the paragraph enumeration was a table, 2nd paragraph was
+ // lost.
+ CPPUNIT_ASSERT_EQUAL(OUString("(k)"), getParagraph(2)->getString());
+}
+
DECLARE_OOXMLEXPORT_TEST(testTdf67207_MERGEFIELD, "mailmerge.docx")
{
uno::Reference<beans::XPropertySet> xTextField = getProperty< uno::Reference<beans::XPropertySet> >(getRun(getParagraph(1), 2), "TextField");