summaryrefslogtreecommitdiffstats
path: root/sw/qa/core/layout/tabfrm.cxx
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 05:03:24 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 05:09:28 +0000
commit97ac77f067910fa5e8206d75160fa63546a9358d (patch)
treee6fa64b43e8150ef65578afa4f1f40f3e19f7fa3 /sw/qa/core/layout/tabfrm.cxx
parentReleasing progress-linux version 4:24.2.2-3~progress7.99u1. (diff)
downloadlibreoffice-97ac77f067910fa5e8206d75160fa63546a9358d.tar.xz
libreoffice-97ac77f067910fa5e8206d75160fa63546a9358d.zip
Merging upstream version 4:24.2.3.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'sw/qa/core/layout/tabfrm.cxx')
-rw-r--r--sw/qa/core/layout/tabfrm.cxx21
1 files changed, 21 insertions, 0 deletions
diff --git a/sw/qa/core/layout/tabfrm.cxx b/sw/qa/core/layout/tabfrm.cxx
index e0d099c771..9bfbd1b82e 100644
--- a/sw/qa/core/layout/tabfrm.cxx
+++ b/sw/qa/core/layout/tabfrm.cxx
@@ -17,6 +17,8 @@
#include <anchoredobject.hxx>
#include <flyfrm.hxx>
#include <flyfrms.hxx>
+#include <docsh.hxx>
+#include <wrtsh.hxx>
namespace
{
@@ -235,6 +237,25 @@ CPPUNIT_TEST_FIXTURE(Test, testSplitFlyWrappedByTableNested)
CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(3), pDoc->GetTableFrameFormats()->GetFormatCount());
CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), pDoc->GetSpzFrameFormats()->GetFormatCount());
}
+
+CPPUNIT_TEST_FIXTURE(Test, testSplitFlyHeader)
+{
+ // Given a document with 8 pages: a first page ending in a manual page break, then a multi-page
+ // floating table on pages 2..8:
+ createSwDoc("floattable-header.docx");
+ CPPUNIT_ASSERT_EQUAL(8, getPages());
+
+ // When creating a new paragraph at doc start:
+ SwDocShell* pDocShell = getSwDocShell();
+ SwWrtShell* pWrtShell = pDocShell->GetWrtShell();
+ pWrtShell->SttEndDoc(/*bStt=*/true);
+ pWrtShell->SplitNode();
+ // Without the accompanying fix in place, this test would have crashed here.
+ pWrtShell->CalcLayout();
+
+ // Then make sure we get one more page, since the first page is now 2 pages:
+ CPPUNIT_ASSERT_EQUAL(9, getPages());
+}
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */