diff options
author | Caolán McNamara <caolan.mcnamara@collabora.com> | 2023-05-19 11:41:59 +0100 |
---|---|---|
committer | Caolán McNamara <caolan.mcnamara@collabora.com> | 2023-05-21 16:06:02 +0200 |
commit | bfc8221c9e903ffe843fceb502b054921a647035 (patch) | |
tree | cb0e4a83889557920e1d854d2ca3d9c385d21758 /sw | |
parent | 58926cc60c7868785c8db126fc199f6731269b86 (diff) |
tdf#155349 add a test case to catch if full invalidation ever returns
Change-Id: Ifea1102fd27643ba950b4c9e8d42dd06c1ce71e7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152001
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/qa/extras/tiledrendering/tiledrendering.cxx | 21 |
1 files changed, 21 insertions, 0 deletions
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<OUString> 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. |