summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorTamás Zolnai <tamas.zolnai@collabora.com>2019-09-21 16:13:14 +0200
committerTamás Zolnai <tamas.zolnai@collabora.com>2019-09-25 12:33:15 +0200
commit72b3b651705b6f5a3d1f02572148c5697af9a8a9 (patch)
tree274be0ed3c6b9b7274c2e17721e7faa47aa91066 /sc
parente740aaf876edd58c1f5c5e17af2495cad36cfc27 (diff)
sc lok: Test invalidation triggered by jumping horizontally on the sheet
Change-Id: Ia3d3b3f3020151939b8fb1cf48635303dc49892e Reviewed-on: https://gerrit.libreoffice.org/79495 Tested-by: Jenkins Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
Diffstat (limited to 'sc')
-rw-r--r--sc/qa/unit/tiledrendering/tiledrendering.cxx29
1 files changed, 29 insertions, 0 deletions
diff --git a/sc/qa/unit/tiledrendering/tiledrendering.cxx b/sc/qa/unit/tiledrendering/tiledrendering.cxx
index 35e61c791db6..acd017773b54 100644
--- a/sc/qa/unit/tiledrendering/tiledrendering.cxx
+++ b/sc/qa/unit/tiledrendering/tiledrendering.cxx
@@ -103,6 +103,7 @@ public:
void testSheetChangeInvalidation();
void testInsertDeletePageInvalidation();
void testGetRowColumnHeadersInvalidation();
+ void testJumpHorizontallyInvalidation();
CPPUNIT_TEST_SUITE(ScTiledRenderingTest);
CPPUNIT_TEST(testRowColumnSelections);
@@ -141,6 +142,7 @@ public:
CPPUNIT_TEST(testSheetChangeInvalidation);
CPPUNIT_TEST(testInsertDeletePageInvalidation);
CPPUNIT_TEST(testGetRowColumnHeadersInvalidation);
+ CPPUNIT_TEST(testJumpHorizontallyInvalidation);
CPPUNIT_TEST_SUITE_END();
private:
@@ -1783,6 +1785,33 @@ void ScTiledRenderingTest::testGetRowColumnHeadersInvalidation()
CPPUNIT_ASSERT_EQUAL(tools::Rectangle(49725, 0, 75225, 19380), aView1.m_aInvalidations[0]);
}
+void ScTiledRenderingTest::testJumpHorizontallyInvalidation()
+{
+ comphelper::LibreOfficeKit::setActive();
+
+ ScModelObj* pModelObj = createDoc("empty.ods");
+ ScViewData* pViewData = ScDocShell::GetViewData();
+ CPPUNIT_ASSERT(pViewData);
+
+ int nView1 = SfxLokHelper::getView();
+ ViewCallback aView1;
+ CPPUNIT_ASSERT(!lcl_hasEditView(*pViewData));
+
+ SfxLokHelper::setView(nView1);
+ aView1.m_bInvalidateTiles = false;
+ aView1.m_aInvalidations.clear();
+ pModelObj->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, awt::Key::PAGEDOWN | KEY_MOD2);
+ pModelObj->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, awt::Key::PAGEDOWN | KEY_MOD2);
+ Scheduler::ProcessEventsToIdle();
+ pModelObj->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, awt::Key::PAGEDOWN | KEY_MOD2);
+ pModelObj->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, awt::Key::PAGEDOWN | KEY_MOD2);
+ Scheduler::ProcessEventsToIdle();
+ CPPUNIT_ASSERT(aView1.m_bInvalidateTiles);
+ CPPUNIT_ASSERT_EQUAL(size_t(2), aView1.m_aInvalidations.size());
+ CPPUNIT_ASSERT_EQUAL(tools::Rectangle(0, 0, 1000000000, 1000000000), aView1.m_aInvalidations[0]);
+ CPPUNIT_ASSERT_EQUAL(tools::Rectangle(26775, 0, 39525, 13005), aView1.m_aInvalidations[1]);
+}
+
}
CPPUNIT_TEST_SUITE_REGISTRATION(ScTiledRenderingTest);