summaryrefslogtreecommitdiff
path: root/sw/qa/extras/layout
diff options
context:
space:
mode:
authorAttila Szűcs <szucs.attila3@nisz.hu>2021-11-18 11:02:01 +0100
committerXisco Fauli <xiscofauli@libreoffice.org>2021-11-30 10:08:34 +0100
commit8a82c6f3f1e85c941ac05b48416450cec813a04e (patch)
treed4a90755723993f06c3496fd36392f7f2bf71bfd /sw/qa/extras/layout
parentbd8e584db0c19a30164575d7fc8c583436db5b85 (diff)
tdf#54465 tdf#139336 sw: add compat. flag for footnote in column
Add compatibility option FOOTNOTE_IN_COLUMN_TO_PAGEEND to keep layout of old ODT files, where multicolumn sections have footnotes in columns, growing sections to the full page. Note: Multicolumn page styles or not evenly distributed multicolumn sections, or footnotes not collected at the end of the sections still use footnotes in columns, so they don't need this compatibility option. Follow-up to commit 4c31b4ef2083087a822c3ae648fd09acc67d2f88 "tdf#139336 sw: fix extra pages of multicolumn sections with footnotes". Co-authored-by: Tibor Nagy (NISZ) Change-Id: I7d6a1f804b555dc5372767014b8fb5e3fa57ba9b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125442 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org> (cherry picked from commit 41cc1d2c0c0c3bfa5ba341311f68df05375859fb) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126001 Reviewed-by: Attila Szűcs <szucs.attila3@nisz.hu> Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org> Tested-by: Jenkins
Diffstat (limited to 'sw/qa/extras/layout')
-rw-r--r--sw/qa/extras/layout/data/tdf54465_ColumnsWithFootnoteDoNotOccupyEntirePage_New.odtbin0 -> 10799 bytes
-rw-r--r--sw/qa/extras/layout/data/tdf54465_ColumnsWithFootnoteDoNotOccupyEntirePage_Old.odtbin0 -> 10216 bytes
-rw-r--r--sw/qa/extras/layout/layout.cxx24
3 files changed, 24 insertions, 0 deletions
diff --git a/sw/qa/extras/layout/data/tdf54465_ColumnsWithFootnoteDoNotOccupyEntirePage_New.odt b/sw/qa/extras/layout/data/tdf54465_ColumnsWithFootnoteDoNotOccupyEntirePage_New.odt
new file mode 100644
index 000000000000..28a19263053a
--- /dev/null
+++ b/sw/qa/extras/layout/data/tdf54465_ColumnsWithFootnoteDoNotOccupyEntirePage_New.odt
Binary files differ
diff --git a/sw/qa/extras/layout/data/tdf54465_ColumnsWithFootnoteDoNotOccupyEntirePage_Old.odt b/sw/qa/extras/layout/data/tdf54465_ColumnsWithFootnoteDoNotOccupyEntirePage_Old.odt
new file mode 100644
index 000000000000..426e684937b3
--- /dev/null
+++ b/sw/qa/extras/layout/data/tdf54465_ColumnsWithFootnoteDoNotOccupyEntirePage_Old.odt
Binary files differ
diff --git a/sw/qa/extras/layout/layout.cxx b/sw/qa/extras/layout/layout.cxx
index 9050a00a86cf..3ef61970f5ae 100644
--- a/sw/qa/extras/layout/layout.cxx
+++ b/sw/qa/extras/layout/layout.cxx
@@ -3733,6 +3733,30 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf139336_ColumnsWithFootnoteDoNotOccup
assertXPath(pXmlDoc, "/root/page", 2);
}
+CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf54465_ColumnsWithFootnoteDoNotOccupyEntirePage)
+{
+ // Old odt files should keep their original layout, as it was before Tdf139336 fix.
+ // The new odt file is only 1 page long, while the old odt file (with the same content)
+ // was more then 1 page long.
+ // Note: Somewhy this test miscalculates the layout of the old odt file.
+ // It will be 4 pages long, while opened in Writer it is 5 pages long.
+ SwDoc* pDoc
+ = createSwDoc(DATA_DIRECTORY, "tdf54465_ColumnsWithFootnoteDoNotOccupyEntirePage_Old.odt");
+ CPPUNIT_ASSERT(pDoc);
+ Scheduler::ProcessEventsToIdle();
+ xmlDocUniquePtr pXmlDoc = parseLayoutDump();
+ xmlXPathObjectPtr pXmlObj = getXPathNode(pXmlDoc, "/root/page");
+ xmlNodeSetPtr pXmlNodes = pXmlObj->nodesetval;
+ CPPUNIT_ASSERT_GREATER(1, xmlXPathNodeSetGetLength(pXmlNodes));
+ xmlXPathFreeObject(pXmlObj);
+
+ discardDumpedLayout();
+ pDoc = createSwDoc(DATA_DIRECTORY, "tdf54465_ColumnsWithFootnoteDoNotOccupyEntirePage_New.odt");
+ CPPUNIT_ASSERT(pDoc);
+ pXmlDoc = parseLayoutDump();
+ assertXPath(pXmlDoc, "/root/page", 1);
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */