summaryrefslogtreecommitdiff
path: root/sw/qa
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2019-09-30 15:02:07 +0200
committerMiklos Vajna <vmiklos@collabora.com>2019-09-30 21:49:33 +0200
commit4814e8caa5f06c4fe438dfd7d7315e4a2410ea18 (patch)
treef16ce1488c37bef43104482a286a209ce3762f20 /sw/qa
parenteeac5b7a424c3a3be48b1c3583171ad97d1b19cd (diff)
tdf#124601 sw: add ContinuousEndnotes layout compat option
Writer has two cases for laying out endnotes: either they are at the end of the section or are on a separate endnote page at the end of the document. Word always puts endnotes as continuous content at the end of the document, not on a separate page. Given that this continuous / separate page behavior difference seems to be not part of the ODF or OOXML file format and neither UI allows to configure this, the best way to resolve this looks like a new layout compat option. At a layout level, the "endnotes at the end of the section" code is close to what we need, we just need to make sure that: 1) Endnotes are never moved backwards, even if their reference moves back. 2) When appending an endnote, they should go to the footnote container on the last page, not close to their reference. With this, the page number in Word and Writer now match for the bugdoc. Change-Id: I6fd0ee191e001d7c3a6df46d5e9fe8d7eb0327dc Reviewed-on: https://gerrit.libreoffice.org/79857 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
Diffstat (limited to 'sw/qa')
-rw-r--r--sw/qa/extras/layout/data/tdf124601.docbin0 -> 23552 bytes
-rw-r--r--sw/qa/extras/layout/layout.cxx17
2 files changed, 17 insertions, 0 deletions
diff --git a/sw/qa/extras/layout/data/tdf124601.doc b/sw/qa/extras/layout/data/tdf124601.doc
new file mode 100644
index 000000000000..fdfde8215f0e
--- /dev/null
+++ b/sw/qa/extras/layout/data/tdf124601.doc
Binary files differ
diff --git a/sw/qa/extras/layout/layout.cxx b/sw/qa/extras/layout/layout.cxx
index a6d70234f423..87a86a354253 100644
--- a/sw/qa/extras/layout/layout.cxx
+++ b/sw/qa/extras/layout/layout.cxx
@@ -3217,6 +3217,23 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf124600)
assertXPath(pXmlDoc, "/root/page/body/txt[2]/LineBreak", 1);
}
+CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf124601)
+{
+ // This is a testcase for the ContinuousEndnotes compat flag.
+ // The document has 2 pages, the endnote anchor is on the first page.
+ // The endnote should be on the 2nd page together with the last page content.
+ createDoc("tdf124601.doc");
+ xmlDocPtr pXmlDoc = parseLayoutDump();
+
+ // Without the accompanying fix in place, this test would have failed with:
+ // - Expected: 2
+ // - Actual : 3
+ // i.e. there was a separate endnote page, even when the ContinuousEndnotes compat option was
+ // on.
+ assertXPath(pXmlDoc, "/root/page", 2);
+ assertXPath(pXmlDoc, "/root/page[2]/ftncont", 1);
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */