[Libreoffice-commits] core.git: sw/qa sw/source
László Németh (via logerrit)
logerrit at kemper.freedesktop.org
Fri Aug 7 07:33:01 UTC 2020
sw/qa/extras/layout/data/tdf88496.docx |binary
sw/qa/extras/layout/layout.cxx | 9 +++++++++
sw/source/core/layout/tabfrm.cxx | 8 ++++++++
3 files changed, 17 insertions(+)
New commits:
commit db3191f408fa2d04bf5870ea2c117e75d410ab5f
Author: László Németh <nemeth at numbertext.org>
AuthorDate: Thu Aug 6 14:46:08 2020 +0200
Commit: László Németh <nemeth at numbertext.org>
CommitDate: Fri Aug 7 09:32:23 2020 +0200
tdf#130639 sw layout: fix table position
at fallback "switch off repeating header"
by removing temporary page break immediately.
Follow-up of commit f7e071a00542c414a7e9d7bcf4434d908f225e59
(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 at numbertext.org>
diff --git a/sw/qa/extras/layout/data/tdf88496.docx b/sw/qa/extras/layout/data/tdf88496.docx
new file mode 100644
index 000000000000..b34f30389e2f
Binary files /dev/null and b/sw/qa/extras/layout/data/tdf88496.docx differ
diff --git a/sw/qa/extras/layout/layout.cxx b/sw/qa/extras/layout/layout.cxx
index 28e4bd568c22..88f0d3802b94 100644
--- a/sw/qa/extras/layout/layout.cxx
+++ b/sw/qa/extras/layout/layout.cxx
@@ -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);
diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx
index 961c1c94171e..a81b7f1c198c 100644
--- a/sw/source/core/layout/tabfrm.cxx
+++ b/sw/source/core/layout/tabfrm.cxx
@@ -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;
More information about the Libreoffice-commits
mailing list