sc/qa/unit/tiledrendering/tiledrendering.cxx | 57 +++++++++++++++++++++++++++ 1 file changed, 57 insertions(+)
New commits: commit 0fb8a52d205ead894901351cba83940706bec895 Author: Tamás Zolnai <tamas.zol...@collabora.com> AuthorDate: Sat Sep 21 16:39:46 2019 +0200 Commit: Tamás Zolnai <tamas.zol...@collabora.com> CommitDate: Thu Sep 26 19:45:58 2019 +0200 sc lok: Test invalidation triggered by jumping to the last row on the sheet Reviewed-on: https://gerrit.libreoffice.org/79496 Reviewed-by: Tamás Zolnai <tamas.zol...@collabora.com> Tested-by: Tamás Zolnai <tamas.zol...@collabora.com> (cherry picked from commit b929d645ad1b0959c1491629dc88d3124794f922) Change-Id: I27e9a1cea465fab2c129754b2ebba978919c2bca Reviewed-on: https://gerrit.libreoffice.org/79622 Reviewed-by: Tamás Zolnai <tamas.zol...@collabora.com> Tested-by: Tamás Zolnai <tamas.zol...@collabora.com> diff --git a/sc/qa/unit/tiledrendering/tiledrendering.cxx b/sc/qa/unit/tiledrendering/tiledrendering.cxx index 5efccc31912f..c2434621ed85 100644 --- a/sc/qa/unit/tiledrendering/tiledrendering.cxx +++ b/sc/qa/unit/tiledrendering/tiledrendering.cxx @@ -107,6 +107,7 @@ public: void testInsertDeletePageInvalidation(); void testGetRowColumnHeadersInvalidation(); void testJumpHorizontallyInvalidation(); + void testJumpToLastRowInvalidation(); CPPUNIT_TEST_SUITE(ScTiledRenderingTest); CPPUNIT_TEST(testRowColumnSelections); @@ -145,6 +146,7 @@ public: CPPUNIT_TEST(testInsertDeletePageInvalidation); CPPUNIT_TEST(testGetRowColumnHeadersInvalidation); CPPUNIT_TEST(testJumpHorizontallyInvalidation); + CPPUNIT_TEST(testJumpToLastRowInvalidation); CPPUNIT_TEST_SUITE_END(); private: @@ -1862,6 +1864,31 @@ void ScTiledRenderingTest::testJumpHorizontallyInvalidation() CPPUNIT_ASSERT_EQUAL(tools::Rectangle(26775, 0, 39525, 13005), aView1.m_aInvalidations[1]); } +void ScTiledRenderingTest::testJumpToLastRowInvalidation() +{ + 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::DOWN | KEY_MOD1); + pModelObj->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, awt::Key::DOWN | KEY_MOD1); + 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(0, 13005, 26775, 127500255), aView1.m_aInvalidations[1]); +} + } CPPUNIT_TEST_SUITE_REGISTRATION(ScTiledRenderingTest); commit be38fb148c1f2f6398ecc8ac40412733e338556b Author: Tamás Zolnai <tamas.zol...@collabora.com> AuthorDate: Sat Sep 21 16:13:14 2019 +0200 Commit: Tamás Zolnai <tamas.zol...@collabora.com> CommitDate: Thu Sep 26 19:45:36 2019 +0200 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.zol...@collabora.com> (cherry picked from commit 72b3b651705b6f5a3d1f02572148c5697af9a8a9) Change-Id: Ia3d3b3f3020151939b8fb1cf48635303dc49892e Reviewed-on: https://gerrit.libreoffice.org/79621 Reviewed-by: Tamás Zolnai <tamas.zol...@collabora.com> Tested-by: Tamás Zolnai <tamas.zol...@collabora.com> diff --git a/sc/qa/unit/tiledrendering/tiledrendering.cxx b/sc/qa/unit/tiledrendering/tiledrendering.cxx index 8c238fd6659d..5efccc31912f 100644 --- a/sc/qa/unit/tiledrendering/tiledrendering.cxx +++ b/sc/qa/unit/tiledrendering/tiledrendering.cxx @@ -106,6 +106,7 @@ public: void testSheetChangeInvalidation(); void testInsertDeletePageInvalidation(); void testGetRowColumnHeadersInvalidation(); + void testJumpHorizontallyInvalidation(); CPPUNIT_TEST_SUITE(ScTiledRenderingTest); CPPUNIT_TEST(testRowColumnSelections); @@ -143,6 +144,7 @@ public: CPPUNIT_TEST(testSheetChangeInvalidation); CPPUNIT_TEST(testInsertDeletePageInvalidation); CPPUNIT_TEST(testGetRowColumnHeadersInvalidation); + CPPUNIT_TEST(testJumpHorizontallyInvalidation); CPPUNIT_TEST_SUITE_END(); private: @@ -1832,6 +1834,34 @@ 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; + 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]); +} + } CPPUNIT_TEST_SUITE_REGISTRATION(ScTiledRenderingTest); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits