summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2018-03-05 22:09:39 +0100
committerJan Holesovsky <kendy@collabora.com>2018-05-22 12:04:01 +0200
commit11514728644853f31de6588e27cb4b9b15765708 (patch)
treecbbd3453f66d9ab45e66d96a6d228dca4fa4b9e4 /sw
parent4c9692bd1de23425b672cfdf82c8f7efba736c44 (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) Conflicts: sw/qa/extras/ooxmlexport/ooxmlexport11.cxx Change-Id: I6395f37aa40c42304e2c918d87dadecb21e9d378 Reviewed-on: https://gerrit.libreoffice.org/51763 Reviewed-by: Aron Budea <aron.budea@collabora.com> Tested-by: Aron Budea <aron.budea@collabora.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/ooxmlexport/data/tdf115861.docxbin0 -> 15035 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport9.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/ooxmlexport9.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx
index d1327a5216fb..fba031390ecc 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx
@@ -709,6 +709,13 @@ DECLARE_OOXMLEXPORT_TEST(testTdf112118_DOCX, "tdf112118.docx")
}
}
+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());
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */