diff options
author | Tamás Zolnai <tamas.zolnai@collabora.com> | 2019-09-13 17:44:36 +0200 |
---|---|---|
committer | Tamás Zolnai <tamas.zolnai@collabora.com> | 2019-09-25 12:21:14 +0200 |
commit | ff0cd54de41e71e24bf7d833b1260c6dbb8dbfea (patch) | |
tree | 8d37d6f4ef666d12140000d89700ee5067e86a41 /sc | |
parent | d877c232c0d63fd509fa8bf9ca433481dfb2b126 (diff) |
sc lok: Test invalidation after sheet change
Change-Id: I799089fc65d92fe72d7e76afbcd44bd4161d25f4
Reviewed-on: https://gerrit.libreoffice.org/79489
Tested-by: Jenkins
Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/qa/unit/tiledrendering/data/two_sheets.ods | bin | 0 -> 7082 bytes | |||
-rw-r--r-- | sc/qa/unit/tiledrendering/tiledrendering.cxx | 24 |
2 files changed, 24 insertions, 0 deletions
diff --git a/sc/qa/unit/tiledrendering/data/two_sheets.ods b/sc/qa/unit/tiledrendering/data/two_sheets.ods Binary files differnew file mode 100644 index 000000000000..6aa1d03be62c --- /dev/null +++ b/sc/qa/unit/tiledrendering/data/two_sheets.ods diff --git a/sc/qa/unit/tiledrendering/tiledrendering.cxx b/sc/qa/unit/tiledrendering/tiledrendering.cxx index 9f1c0435108b..93f683ffc985 100644 --- a/sc/qa/unit/tiledrendering/tiledrendering.cxx +++ b/sc/qa/unit/tiledrendering/tiledrendering.cxx @@ -100,6 +100,7 @@ public: void testVbaRangeCopyPaste(); void testInvalidationLoop(); void testPageDownInvalidation(); + void testSheetChangeInvalidation(); CPPUNIT_TEST_SUITE(ScTiledRenderingTest); CPPUNIT_TEST(testRowColumnSelections); @@ -135,6 +136,7 @@ public: CPPUNIT_TEST(testVbaRangeCopyPaste); CPPUNIT_TEST(testInvalidationLoop); CPPUNIT_TEST(testPageDownInvalidation); + CPPUNIT_TEST(testSheetChangeInvalidation); CPPUNIT_TEST_SUITE_END(); private: @@ -1669,6 +1671,28 @@ void ScTiledRenderingTest::testPageDownInvalidation() CPPUNIT_ASSERT_EQUAL(tools::Rectangle(15, 15, 1230, 225), aView1.m_aInvalidation); } +void ScTiledRenderingTest::testSheetChangeInvalidation() +{ + comphelper::LibreOfficeKit::setActive(); + + ScModelObj* pModelObj = createDoc("two_sheets.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_aInvalidation = tools::Rectangle(); + pModelObj->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, awt::Key::PAGEDOWN | KEY_MOD1); + pModelObj->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, awt::Key::PAGEDOWN | KEY_MOD1); + Scheduler::ProcessEventsToIdle(); + CPPUNIT_ASSERT(aView1.m_bInvalidateTiles); + CPPUNIT_ASSERT_EQUAL(tools::Rectangle(0, 0, 1310720, 268435456), aView1.m_aInvalidation); +} + } CPPUNIT_TEST_SUITE_REGISTRATION(ScTiledRenderingTest); |