summaryrefslogtreecommitdiff
path: root/sw/qa/extras/layout
diff options
context:
space:
mode:
authorAttila Szűcs <szucs.attila3@nisz.hu>2021-09-08 15:51:16 +0200
committerLászló Németh <nemeth@numbertext.org>2021-11-02 16:31:24 +0100
commit4c31b4ef2083087a822c3ae648fd09acc67d2f88 (patch)
tree9dd046549b87431e4cab702cb183b54390908898 /sw/qa/extras/layout
parent83298077a4cd577860e2114b429a2d413c3ea10c (diff)
tdf#139336 sw: fix extra pages of multicolumn sections with footnotes
Adding footnotes to multicolumn sections resulted page-long section layout, not regarding to the amount of its text content. E.g. a page with n multicolumn sections and footnotes could load as n (mostly empty) pages. The problem is related to the footnotes showed under columns of sections, which can be ambiguous at different column number of the different sections on the same page. As a workaround for interoperability, show footnotes per pages to remove the extra pages, e.g. allowing to show the separated sections on a single page, like MSO does. Note: a compatibility option will be added to avoid regressions. Note: This fix doesn't change multicolumn page styles or not evenly distributed multicolumn sections or footnotes not collected at the end of the sections. Test: choose Edit Section... in local menu of the sections of the unit test document. In Options..., see checkbox "Evenly distribute contents to all columns" on page Columns, and Footnotes/"Collect at end of text" on page Footnotes/Endnotes. To see the result of the new settings, save and reload the document. Note: DOCX format doesn't support "Collect at end of text", only OpenDocument. Note: In MSO, it's possible to set multimulticolumn footnotes separately from section column number. It's column number can be 1–4, or "auto", which uses the column number of the first section of the page. See also tdf#138508 (Single column footnotes on multi-column pages). Change-Id: I6a3534ac043971479275a3e8bb0713bd3d8ceaa4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121822 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'sw/qa/extras/layout')
-rw-r--r--sw/qa/extras/layout/data/tdf139336_ColumnsWithFootnoteDoNotOccupyEntirePage.docxbin0 -> 17622 bytes
-rw-r--r--sw/qa/extras/layout/layout.cxx14
2 files changed, 14 insertions, 0 deletions
diff --git a/sw/qa/extras/layout/data/tdf139336_ColumnsWithFootnoteDoNotOccupyEntirePage.docx b/sw/qa/extras/layout/data/tdf139336_ColumnsWithFootnoteDoNotOccupyEntirePage.docx
new file mode 100644
index 000000000000..a44ff4047111
--- /dev/null
+++ b/sw/qa/extras/layout/data/tdf139336_ColumnsWithFootnoteDoNotOccupyEntirePage.docx
Binary files differ
diff --git a/sw/qa/extras/layout/layout.cxx b/sw/qa/extras/layout/layout.cxx
index 1b7ad51d71c2..9050a00a86cf 100644
--- a/sw/qa/extras/layout/layout.cxx
+++ b/sw/qa/extras/layout/layout.cxx
@@ -3719,6 +3719,20 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf135035)
CPPUNIT_ASSERT_GREATER(nParentWidth, nFly3Width);
}
+CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf139336_ColumnsWithFootnoteDoNotOccupyEntirePage)
+{
+ SwDoc* pDoc
+ = createSwDoc(DATA_DIRECTORY, "tdf139336_ColumnsWithFootnoteDoNotOccupyEntirePage.docx");
+ CPPUNIT_ASSERT(pDoc);
+ xmlDocUniquePtr pXmlDoc = parseLayoutDump();
+ // Without the fix, it would be 5 pages, but with the fix the whole document
+ // would fit into 1 page, but it will be 2 pages right now, because
+ // when writer import (from docx) the last section with columns, then it does not set
+ // the evenly distributed settings, and this settings is required for the fix now, to
+ // avoid some regression.
+ assertXPath(pXmlDoc, "/root/page", 2);
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */