sw/qa/extras/layout/data/tdf116848.odt |binary sw/qa/extras/layout/layout.cxx | 9 +++++++++ sw/source/core/layout/findfrm.cxx | 5 ++++- 3 files changed, 13 insertions(+), 1 deletion(-)
New commits: commit e4b335fac90a2128a5df3641050d6382883de1e8 Author: Miklos Vajna <vmik...@collabora.co.uk> Date: Mon Apr 16 22:14:12 2018 +0200 tdf#116848 sw, sections in tables: no split in headers or footers The motivation for split section-in-tables was multiple pages, so disabling it for headers/footers is not a problem, and fixes the layout loop. Change-Id: I3e13690f6e6b50c35417f8a4f7886fd0befe7962 Reviewed-on: https://gerrit.libreoffice.org/53006 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Miklos Vajna <vmik...@collabora.co.uk> diff --git a/sw/qa/extras/layout/data/tdf116848.odt b/sw/qa/extras/layout/data/tdf116848.odt new file mode 100644 index 000000000000..e3a96c78a521 Binary files /dev/null and b/sw/qa/extras/layout/data/tdf116848.odt differ diff --git a/sw/qa/extras/layout/layout.cxx b/sw/qa/extras/layout/layout.cxx index 9a73e2025147..aa2146354fc0 100644 --- a/sw/qa/extras/layout/layout.cxx +++ b/sw/qa/extras/layout/layout.cxx @@ -19,11 +19,13 @@ public: void testTdf116830(); void testTdf116925(); void testTdf117028(); + void testTdf116848(); CPPUNIT_TEST_SUITE(SwLayoutWriter); CPPUNIT_TEST(testTdf116830); CPPUNIT_TEST(testTdf116925); CPPUNIT_TEST(testTdf117028); + CPPUNIT_TEST(testTdf116848); CPPUNIT_TEST_SUITE_END(); private: @@ -108,6 +110,13 @@ void SwLayoutWriter::testTdf117028() assertXPathContent(pXmlDoc, "//textarray/text", "Hello"); } +void SwLayoutWriter::testTdf116848() +{ + SwDoc* pDoc = createDoc("tdf116848.odt"); + // This resulted in a layout loop. + pDoc->getIDocumentLayoutAccess().GetCurrentViewShell()->CalcLayout(); +} + CPPUNIT_TEST_SUITE_REGISTRATION(SwLayoutWriter); CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/sw/source/core/layout/findfrm.cxx b/sw/source/core/layout/findfrm.cxx index 60b37f363555..baca3edfa189 100644 --- a/sw/source/core/layout/findfrm.cxx +++ b/sw/source/core/layout/findfrm.cxx @@ -1265,9 +1265,12 @@ static bool lcl_IsInSectionDirectly( const SwFrame *pUp ) else if( pUp->IsSctFrame() ) { auto pSection = static_cast<const SwSectionFrame*>(pUp); + const SwFrame* pHeaderFooter = pSection->FindFooterOrHeader(); + // When the section frame is not in header/footer: // Allow move of frame in case our only column is not growable. // Also allow if there is a previous section frame (to move back). - return bSeenColumn || !pSection->Growable() || pSection->GetPrecede(); + bool bAllowOutsideHeaderFooter = !pSection->Growable() || pSection->GetPrecede(); + return bSeenColumn || (!pHeaderFooter && bAllowOutsideHeaderFooter); } else if( pUp->IsTabFrame() ) return false; _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits