tdf#130639 sw layout: fix table position

at fallback "switch off repeating header"
by removing temporary page break immediately.

Follow-up of commit f7e071a005
(tdf#88496 DOCX: disable long repeating table header).

Change-Id: I3ae62456fd50f3f3fa25bfea5326a8eb9bef01c6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100245
Tested-by: Jenkins
Reviewed-by: László Németh <nemeth@numbertext.org>
This commit is contained in:
László Németh
2020-08-06 14:46:08 +02:00
parent e87fb75453
commit db3191f408
3 changed files with 17 additions and 0 deletions

Binary file not shown.

View File

@@ -467,6 +467,15 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, TestTdf134272)
assertXPath(pXmlDoc, "/root/page[1]/header/txt[2]/infos/bounds", "bottom", "2819");
}
CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf88496)
{
SwDoc* pDoc = createDoc("tdf88496.docx");
CPPUNIT_ASSERT(pDoc);
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
// This was 4, table fallback "switch off repeating header" started on a new page
assertXPath(pXmlDoc, "/root/page", 3);
}
CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFlysInHeader)
{
loadURL("private:factory/swriter", nullptr);

View File

@@ -2494,6 +2494,14 @@ void SwTabFrame::MakeAll(vcl::RenderContext* pRenderContext)
}
const bool bSplitError = !Split( nDeadLine, bTryToSplit, ( bTableRowKeep && !(bAllowSplitOfRow || bEmulateTableKeepSplitAllowed) ) );
// tdf#130639 don't start table on a new page after the fallback "switch off repeating header"
if (bSplitError && nRepeat > GetTable()->GetRowsToRepeat())
{
setFrameAreaPositionValid(false);
break;
}
if (!bTryToSplit && !bSplitError)
{
--nUnSplitted;