diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2023-03-21 13:30:49 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2023-03-24 07:04:34 +0000 |
commit | 13957c49b939d29c0005c578e6c5e8dd76bd5722 (patch) | |
tree | d0a174bfbd7fa3a8681acacce7cc1a9753a4e8a9 | |
parent | 692db60d346ea93270a066cba44bb8bb0ac8f7cb (diff) |
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 <vmiklos@collabora.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
-rw-r--r-- | sw/qa/extras/ooxmlimport/ooxmlimport2.cxx | 19 |
1 files 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 <docsh.hxx> #include <rootfrm.hxx> #include <frame.hxx> +#include <pagefrm.hxx> +#include <cntfrm.hxx> +#include <flyfrms.hxx> +#include <tabfrm.hxx> 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<SwPageFrame*>(pLayout->Lower()); + CPPUNIT_ASSERT(pPage1); + const SwSortedObjs& rPage1Objs = *pPage1->GetSortedObjs(); + CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), rPage1Objs.size()); + auto pPage1Fly = dynamic_cast<SwFlyAtContentFrame*>(rPage1Objs[0]); + CPPUNIT_ASSERT(pPage1Fly); + auto pTab1 = dynamic_cast<SwTabFrame*>(pPage1Fly->GetLower()); + CPPUNIT_ASSERT(pTab1); + CPPUNIT_ASSERT(pTab1->HasFollow()); } CPPUNIT_TEST_FIXTURE(Test, testTdf119200) |