Kaydet (Commit) e4b335fa authored tarafından Miklos Vajna's avatar Miklos Vajna

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/53006Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarMiklos Vajna <vmiklos@collabora.co.uk>
üst cc3690c9
...@@ -19,11 +19,13 @@ public: ...@@ -19,11 +19,13 @@ public:
void testTdf116830(); void testTdf116830();
void testTdf116925(); void testTdf116925();
void testTdf117028(); void testTdf117028();
void testTdf116848();
CPPUNIT_TEST_SUITE(SwLayoutWriter); CPPUNIT_TEST_SUITE(SwLayoutWriter);
CPPUNIT_TEST(testTdf116830); CPPUNIT_TEST(testTdf116830);
CPPUNIT_TEST(testTdf116925); CPPUNIT_TEST(testTdf116925);
CPPUNIT_TEST(testTdf117028); CPPUNIT_TEST(testTdf117028);
CPPUNIT_TEST(testTdf116848);
CPPUNIT_TEST_SUITE_END(); CPPUNIT_TEST_SUITE_END();
private: private:
...@@ -108,6 +110,13 @@ void SwLayoutWriter::testTdf117028() ...@@ -108,6 +110,13 @@ void SwLayoutWriter::testTdf117028()
assertXPathContent(pXmlDoc, "//textarray/text", "Hello"); 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_TEST_SUITE_REGISTRATION(SwLayoutWriter);
CPPUNIT_PLUGIN_IMPLEMENT(); CPPUNIT_PLUGIN_IMPLEMENT();
......
...@@ -1265,9 +1265,12 @@ static bool lcl_IsInSectionDirectly( const SwFrame *pUp ) ...@@ -1265,9 +1265,12 @@ static bool lcl_IsInSectionDirectly( const SwFrame *pUp )
else if( pUp->IsSctFrame() ) else if( pUp->IsSctFrame() )
{ {
auto pSection = static_cast<const SwSectionFrame*>(pUp); 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. // Allow move of frame in case our only column is not growable.
// Also allow if there is a previous section frame (to move back). // 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() ) else if( pUp->IsTabFrame() )
return false; return false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment