sw/qa/extras/layout/layout2.cxx | 35 +++++++++++++++++++++++++++++++++++ sw/qa/extras/uiwriter/uiwriter5.cxx | 34 ---------------------------------- 2 files changed, 35 insertions(+), 34 deletions(-)
New commits: commit d0d780a05e03414e59a40e5c950bd2487a55e714 Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Sun May 1 15:23:54 2022 +0100 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Mon May 2 11:32:51 2022 +0200 move layout-dependent test to explicit layout cppunit target Change-Id: If1d4c6047df5a69b5cf8f9e9a970c1ecad754ce5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133670 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caol...@redhat.com> diff --git a/sw/qa/extras/uiwriter/data/tdf124261.docx b/sw/qa/extras/layout/data/tdf124261.docx similarity index 100% rename from sw/qa/extras/uiwriter/data/tdf124261.docx rename to sw/qa/extras/layout/data/tdf124261.docx diff --git a/sw/qa/extras/layout/layout2.cxx b/sw/qa/extras/layout/layout2.cxx index faf978d65f1e..f88fbdc94f71 100644 --- a/sw/qa/extras/layout/layout2.cxx +++ b/sw/qa/extras/layout/layout2.cxx @@ -21,6 +21,7 @@ #include <unotxdoc.hxx> #include <rootfrm.hxx> +#include <txtfrm.hxx> #include <wrtsh.hxx> #include <IDocumentLayoutAccess.hxx> #include <IDocumentRedlineAccess.hxx> @@ -1917,6 +1918,40 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testUserFieldTypeLanguage) "1,234.56"); } +CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf124261) +{ +#if !defined(_WIN32) + // Make sure that pressing a key in a btlr cell frame causes an immediate, correct repaint. + SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf124261.docx"); + SwRootFrame* pLayout = pDoc->getIDocumentLayoutAccess().GetCurrentLayout(); + SwFrame* pPageFrame = pLayout->GetLower(); + CPPUNIT_ASSERT(pPageFrame->IsPageFrame()); + + SwFrame* pBodyFrame = pPageFrame->GetLower(); + CPPUNIT_ASSERT(pBodyFrame->IsBodyFrame()); + + SwFrame* pTabFrame = pBodyFrame->GetLower(); + CPPUNIT_ASSERT(pTabFrame->IsTabFrame()); + + SwFrame* pRowFrame = pTabFrame->GetLower(); + CPPUNIT_ASSERT(pRowFrame->IsRowFrame()); + + SwFrame* pCellFrame = pRowFrame->GetLower(); + CPPUNIT_ASSERT(pCellFrame->IsCellFrame()); + + SwFrame* pFrame = pCellFrame->GetLower(); + CPPUNIT_ASSERT(pFrame->IsTextFrame()); + + // Make sure that the text frame's area and the paint rectangle match. + // Without the accompanying fix in place, this test would have failed with 'Expected: 1721; + // Actual: 1547', i.e. an area other than the text frame was invalidated for a single-line + // paragraph. + SwTextFrame* pTextFrame = static_cast<SwTextFrame*>(pFrame); + SwRect aRect = pTextFrame->GetPaintSwRect(); + CPPUNIT_ASSERT_EQUAL(pTextFrame->getFrameArea().Top(), aRect.Top()); +#endif +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/qa/extras/uiwriter/uiwriter5.cxx b/sw/qa/extras/uiwriter/uiwriter5.cxx index dbd804164671..dec49313d195 100644 --- a/sw/qa/extras/uiwriter/uiwriter5.cxx +++ b/sw/qa/extras/uiwriter/uiwriter5.cxx @@ -943,40 +943,6 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf147006) CPPUNIT_ASSERT_EQUAL(sal_Int32(0), rIDMA.getAllMarksCount()); } -CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf124261) -{ -#if !defined(_WIN32) - // Make sure that pressing a key in a btlr cell frame causes an immediate, correct repaint. - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf124261.docx"); - SwRootFrame* pLayout = pDoc->getIDocumentLayoutAccess().GetCurrentLayout(); - SwFrame* pPageFrame = pLayout->GetLower(); - CPPUNIT_ASSERT(pPageFrame->IsPageFrame()); - - SwFrame* pBodyFrame = pPageFrame->GetLower(); - CPPUNIT_ASSERT(pBodyFrame->IsBodyFrame()); - - SwFrame* pTabFrame = pBodyFrame->GetLower(); - CPPUNIT_ASSERT(pTabFrame->IsTabFrame()); - - SwFrame* pRowFrame = pTabFrame->GetLower(); - CPPUNIT_ASSERT(pRowFrame->IsRowFrame()); - - SwFrame* pCellFrame = pRowFrame->GetLower(); - CPPUNIT_ASSERT(pCellFrame->IsCellFrame()); - - SwFrame* pFrame = pCellFrame->GetLower(); - CPPUNIT_ASSERT(pFrame->IsTextFrame()); - - // Make sure that the text frame's area and the paint rectangle match. - // Without the accompanying fix in place, this test would have failed with 'Expected: 1721; - // Actual: 1547', i.e. an area other than the text frame was invalidated for a single-line - // paragraph. - SwTextFrame* pTextFrame = static_cast<SwTextFrame*>(pFrame); - SwRect aRect = pTextFrame->GetPaintSwRect(); - CPPUNIT_ASSERT_EQUAL(pTextFrame->getFrameArea().Top(), aRect.Top()); -#endif -} - CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testDocxAttributeTableExport) { createSwDoc(DATA_DIRECTORY, "floating-table-position.docx");