sc/qa/unit/tiledrendering/data/two_sheets.ods |binary sc/qa/unit/tiledrendering/tiledrendering.cxx | 29 ++++++++++++++++++++++++++ 2 files changed, 29 insertions(+)
New commits: commit ddf104fd3f0f5b981a5b8a86d44afe4a99cace02 Author: Tamás Zolnai <tamas.zol...@collabora.com> AuthorDate: Fri Sep 13 17:44:36 2019 +0200 Commit: Tamás Zolnai <tamas.zol...@collabora.com> CommitDate: Thu Sep 26 19:43:26 2019 +0200 sc lok: Test invalidation after sheet change Reviewed-on: https://gerrit.libreoffice.org/79489 Tested-by: Jenkins Reviewed-by: Tamás Zolnai <tamas.zol...@collabora.com> (cherry picked from commit ff0cd54de41e71e24bf7d833b1260c6dbb8dbfea) Change-Id: I799089fc65d92fe72d7e76afbcd44bd4161d25f4 Reviewed-on: https://gerrit.libreoffice.org/79615 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-by: Tamás Zolnai <tamas.zol...@collabora.com> diff --git a/sc/qa/unit/tiledrendering/data/two_sheets.ods b/sc/qa/unit/tiledrendering/data/two_sheets.ods new file mode 100644 index 000000000000..6aa1d03be62c Binary files /dev/null and b/sc/qa/unit/tiledrendering/data/two_sheets.ods differ diff --git a/sc/qa/unit/tiledrendering/tiledrendering.cxx b/sc/qa/unit/tiledrendering/tiledrendering.cxx index 5960ffd6705b..9db5a4a67a18 100644 --- a/sc/qa/unit/tiledrendering/tiledrendering.cxx +++ b/sc/qa/unit/tiledrendering/tiledrendering.cxx @@ -103,6 +103,7 @@ public: void testFilterDlg(); void testVbaRangeCopyPaste(); void testPageDownInvalidation(); + void testSheetChangeInvalidation(); CPPUNIT_TEST_SUITE(ScTiledRenderingTest); CPPUNIT_TEST(testRowColumnSelections); @@ -137,6 +138,7 @@ public: CPPUNIT_TEST(testFilterDlg); CPPUNIT_TEST(testVbaRangeCopyPaste); CPPUNIT_TEST(testPageDownInvalidation); + CPPUNIT_TEST(testSheetChangeInvalidation); CPPUNIT_TEST_SUITE_END(); private: @@ -1715,6 +1717,29 @@ 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; + SfxViewShell::Current()->registerLibreOfficeKitViewCallback(&ViewCallback::callback, &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); commit 0cd9dabda07e85fdb07e16dbda7e690248e38596 Author: Tamás Zolnai <tamas.zol...@collabora.com> AuthorDate: Fri Sep 13 17:19:57 2019 +0200 Commit: Tamás Zolnai <tamas.zol...@collabora.com> CommitDate: Thu Sep 26 19:43:12 2019 +0200 sc lok: Test also the invalidation rectangle in case of row/column insertion Change-Id: I5dffc0521ae7ef3ddd47574a85457ddcec2a0566 Reviewed-on: https://gerrit.libreoffice.org/79488 Tested-by: Jenkins Reviewed-by: Tamás Zolnai <tamas.zol...@collabora.com> (cherry picked from commit d877c232c0d63fd509fa8bf9ca433481dfb2b126) Reviewed-on: https://gerrit.libreoffice.org/79614 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 9af250ddca16..5960ffd6705b 100644 --- a/sc/qa/unit/tiledrendering/tiledrendering.cxx +++ b/sc/qa/unit/tiledrendering/tiledrendering.cxx @@ -1040,9 +1040,11 @@ void ScTiledRenderingTest::testInvalidateOnInserRowCol() // insert row aView.m_bInvalidateTiles = false; + aView.m_aInvalidation = tools::Rectangle(); comphelper::dispatchCommand(".uno:InsertRows", aArgs); Scheduler::ProcessEventsToIdle(); CPPUNIT_ASSERT(aView.m_bInvalidateTiles); + CPPUNIT_ASSERT_EQUAL(tools::Rectangle(-75, 50985, 32212230, 63990), aView.m_aInvalidation); // move on the right for (int i = 0; i < 200; ++i) @@ -1054,9 +1056,11 @@ void ScTiledRenderingTest::testInvalidateOnInserRowCol() // insert column aView.m_bInvalidateTiles = false; + aView.m_aInvalidation = tools::Rectangle(); comphelper::dispatchCommand(".uno:InsertColumns", aArgs); Scheduler::ProcessEventsToIdle(); CPPUNIT_ASSERT(aView.m_bInvalidateTiles); + CPPUNIT_ASSERT_EQUAL(tools::Rectangle(253650, -15, 32212230, 63990), aView.m_aInvalidation); } void ScTiledRenderingTest::testCommentCallback() _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits