summaryrefslogtreecommitdiff
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-27 13:12:42 +0200
commit22fa509b6aa3fa042b371034b895b15478a89314 (patch)
treeda35a2877f7cad2c5ad566ecf665a2ce97deaa2e
parentb9a41aebe98f3d90c81bae559b2908047a2327ee (diff)
sc lok: Test invalidation triggered by jumping horizontally on the sheet
Reviewed-on: https://gerrit.libreoffice.org/79495 Tested-by: Jenkins Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com> (cherry picked from commit 72b3b651705b6f5a3d1f02572148c5697af9a8a9) Change-Id: Ia3d3b3f3020151939b8fb1cf48635303dc49892e Reviewed-on: https://gerrit.libreoffice.org/79621 Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com> Tested-by: Tamás Zolnai <tamas.zolnai@collabora.com>
-rw-r--r--sc/qa/unit/tiledrendering/tiledrendering.cxx34
1 files changed, 34 insertions, 0 deletions
diff --git a/sc/qa/unit/tiledrendering/tiledrendering.cxx b/sc/qa/unit/tiledrendering/tiledrendering.cxx
index 6ee0419e3a18..653a39f4eea0 100644
--- a/sc/qa/unit/tiledrendering/tiledrendering.cxx
+++ b/sc/qa/unit/tiledrendering/tiledrendering.cxx
@@ -101,6 +101,7 @@ public:
void testSheetChangeInvalidation();
void testInsertDeletePageInvalidation();
void testGetRowColumnHeadersInvalidation();
+ void testJumpHorizontallyInvalidation();
CPPUNIT_TEST_SUITE(ScTiledRenderingTest);
CPPUNIT_TEST(testRowColumnSelections);
@@ -138,6 +139,7 @@ public:
CPPUNIT_TEST(testSheetChangeInvalidation);
CPPUNIT_TEST(testInsertDeletePageInvalidation);
CPPUNIT_TEST(testGetRowColumnHeadersInvalidation);
+ CPPUNIT_TEST(testJumpHorizontallyInvalidation);
CPPUNIT_TEST_SUITE_END();
private:
@@ -1846,6 +1848,38 @@ void ScTiledRenderingTest::testGetRowColumnHeadersInvalidation()
comphelper::LibreOfficeKit::setActive(false);
}
+void ScTiledRenderingTest::testJumpHorizontallyInvalidation()
+{
+ comphelper::LibreOfficeKit::setActive();
+
+ ScModelObj* pModelObj = createDoc("empty.ods");
+ ScViewData* pViewData = ScDocShell::GetViewData();
+ CPPUNIT_ASSERT(pViewData);
+
+ int nView1 = SfxLokHelper::getView();
+ ViewCallback aView1;
+ SfxViewShell::Current()->registerLibreOfficeKitViewCallback(&ViewCallback::callback, &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]);
+
+ mxComponent->dispose();
+ mxComponent.clear();
+ comphelper::LibreOfficeKit::setActive(false);
+}
+
}
CPPUNIT_TEST_SUITE_REGISTRATION(ScTiledRenderingTest);