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

tdf#112741 sw split sections inside table cells: fix table re-layout

The bugdoc has a section large enough that it is split across 4 pages.
The section is inside a nested table. First we lay this out properly,
but when later laying out the footer we need to redo the body frame
layout, which first undoes the split of the table/nested table/section.

This fails, the master second and its 3 follows are expected to be moved
back to the first page (and merged together), but
SwSectionFrame::MakeAll() did this only for the first follow, which was
moved to the first page, not for the other 2 follows which were on other
pages.

Fix the problem by merging not only follows which are also next to the
section frame, but also the ones which are follows (but not nexts).

Change-Id: I7a69aa58336a50d4f37808ccb105b443c2f6993c
üst f00d5385
This diff is collapsed.
......@@ -270,6 +270,7 @@ public:
void testSectionInTableInTable2();
void testTdf112160();
void testLinesMoveBackwardsInSectionInTable();
void testTdf112741();
#endif
void testLinesInSectionInTable();
void testParagraphOfTextRange();
......@@ -426,6 +427,7 @@ public:
CPPUNIT_TEST(testSectionInTableInTable2);
CPPUNIT_TEST(testTdf112160);
CPPUNIT_TEST(testLinesMoveBackwardsInSectionInTable);
CPPUNIT_TEST(testTdf112741);
#endif
CPPUNIT_TEST(testLinesInSectionInTable);
CPPUNIT_TEST(testParagraphOfTextRange);
......@@ -5177,6 +5179,19 @@ void SwUiWriterTest::testTableInNestedSection()
assertXPath(pXmlDoc, "//page[2]//section/tab", 1);
}
void SwUiWriterTest::testTdf112741()
{
createDoc("tdf112741.fodt");
xmlDocPtr pXmlDoc = parseLayoutDump();
// This was 5 pages.
assertXPath(pXmlDoc, "//page", 4);
assertXPath(pXmlDoc, "//page[1]/body/tab/row/cell/tab/row/cell/section", 1);
assertXPath(pXmlDoc, "//page[2]/body/tab/row/cell/tab/row/cell/section", 1);
// This failed, 3rd page contained no sections.
assertXPath(pXmlDoc, "//page[3]/body/tab/row/cell/tab/row/cell/section", 1);
assertXPath(pXmlDoc, "//page[4]/body/tab/row/cell/tab/row/cell/section", 1);
}
void SwUiWriterTest::testTableInSectionInTable()
{
// The document has a table, containing a section, containing a nested
......
......@@ -738,7 +738,14 @@ void SwSectionFrame::MakeAll(vcl::RenderContext* /*pRenderContext*/)
// OD 2004-03-15 #116561# - In online layout join the follows, if section
// can grow.
const SwViewShell *pSh = getRootFrame()->GetCurrShell();
if( pSh && pSh->GetViewOptions()->getBrowseMode() &&
// Split sections inside table cells: need to merge all follows of the
// section here, as later we won't attempt doing so.
bool bCanContainSplitSection = false;
if (IsInTab() && GetUpper())
bCanContainSplitSection = CanContainSplitSection(GetUpper());
if( pSh && (pSh->GetViewOptions()->getBrowseMode() || bCanContainSplitSection) &&
( Grow( LONG_MAX, true ) > 0 ) )
{
while( GetFollow() )
......
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