From bfc8221c9e903ffe843fceb502b054921a647035 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Caol=C3=A1n=20McNamara?= Date: Fri, 19 May 2023 11:41:59 +0100 Subject: [PATCH] tdf#155349 add a test case to catch if full invalidation ever returns MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Change-Id: Ifea1102fd27643ba950b4c9e8d42dd06c1ce71e7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152001 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- sw/qa/extras/tiledrendering/tiledrendering.cxx | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/sw/qa/extras/tiledrendering/tiledrendering.cxx b/sw/qa/extras/tiledrendering/tiledrendering.cxx index 412ff2be7bf0..2fbe09c0a90b 100644 --- a/sw/qa/extras/tiledrendering/tiledrendering.cxx +++ b/sw/qa/extras/tiledrendering/tiledrendering.cxx @@ -107,6 +107,7 @@ protected: int m_nRedlineTableSizeChanged; int m_nRedlineTableEntryModified; int m_nTrackedChangeIndex; + bool m_bFullInvalidateSeen; OString m_sHyperlinkText; OString m_sHyperlinkLink; OString m_aFormFieldButton; @@ -124,6 +125,7 @@ SwTiledRenderingTest::SwTiledRenderingTest() m_nRedlineTableSizeChanged(0), m_nRedlineTableEntryModified(0), m_nTrackedChangeIndex(-1), + m_bFullInvalidateSeen(false), m_callbackWrapper(&callback, this) { } @@ -194,7 +196,11 @@ void SwTiledRenderingTest::callbackImpl(int nType, const char* pPayload) tools::Rectangle aInvalidation; uno::Sequence aSeq = comphelper::string::convertCommaSeparated(OUString::createFromAscii(pPayload)); if (std::string_view("EMPTY") == pPayload) + { + m_bFullInvalidateSeen = true; return; + } + CPPUNIT_ASSERT(aSeq.getLength() == 4 || aSeq.getLength() == 5); aInvalidation.SetLeft(aSeq[0].toInt32()); aInvalidation.SetTop(aSeq[1].toInt32()); @@ -3531,6 +3537,21 @@ CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testBulletDeleteInvalidation) CPPUNIT_ASSERT(!aFirstTextRect.Overlaps(m_aInvalidations)); } +CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testTdf155349) +{ + SwXTextDocument* pXTextDocument = createDoc(); + SwWrtShell* pWrtShell = pXTextDocument->GetDocShell()->GetWrtShell(); + Scheduler::ProcessEventsToIdle(); + setupLibreOfficeKitViewCallback(pWrtShell->GetSfxViewShell()); + pWrtShell->Insert2("a"); + Scheduler::ProcessEventsToIdle(); + pWrtShell->Insert2("b"); + m_bFullInvalidateSeen = false; + Scheduler::ProcessEventsToIdle(); + // before fix for tdf#155349 the total area got invalidated when changing one line + CPPUNIT_ASSERT(!m_bFullInvalidateSeen); +} + CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testBulletNoNumInvalidation) { // Given a document with 3 paragraphs: all are bulleted. -- 2.11.4.GIT