From 13957c49b939d29c0005c578e6c5e8dd76bd5722 Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Tue, 21 Mar 2023 13:30:49 +0100 Subject: sw floattable, CppunitTest_sw_ooxmlimport2: assert the layout in testTdf114217 The point is that the table is multi-page, which is preserved. The detail that it's not in a fly is no longer true. (cherry picked from commit 28b16870553f436b8dd0f74894896136057402a3) Change-Id: I8fa61391eb26b434cd7e8b8adb5012c4909e5553 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149287 Tested-by: Miklos Vajna Reviewed-by: Miklos Vajna --- sw/qa/extras/ooxmlimport/ooxmlimport2.cxx | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx index 26ad31df3a78..1dfa519fd5fd 100644 --- a/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx +++ b/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx @@ -37,6 +37,10 @@ #include #include #include +#include +#include +#include +#include class Test : public SwModelTestBase { @@ -666,9 +670,20 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf121804) CPPUNIT_TEST_FIXTURE(Test, testTdf114217) { + SwModelTestBase::FlySplitGuard aGuard; + // The floating table was not split between page 1 and page 2. createSwDoc("tdf114217.docx"); - // This was 1, multi-page table was imported as a floating one. - CPPUNIT_ASSERT_EQUAL(0, getShapes()); + SwDoc* pDoc = getSwDoc(); + SwRootFrame* pLayout = pDoc->getIDocumentLayoutAccess().GetCurrentLayout(); + auto pPage1 = dynamic_cast(pLayout->Lower()); + CPPUNIT_ASSERT(pPage1); + const SwSortedObjs& rPage1Objs = *pPage1->GetSortedObjs(); + CPPUNIT_ASSERT_EQUAL(static_cast(1), rPage1Objs.size()); + auto pPage1Fly = dynamic_cast(rPage1Objs[0]); + CPPUNIT_ASSERT(pPage1Fly); + auto pTab1 = dynamic_cast(pPage1Fly->GetLower()); + CPPUNIT_ASSERT(pTab1); + CPPUNIT_ASSERT(pTab1->HasFollow()); } CPPUNIT_TEST_FIXTURE(Test, testTdf119200) -- cgit