sc/qa/unit/tiledrendering/tiledrendering.cxx | 35 +++++++++++++++++++++++++++ 1 file changed, 35 insertions(+)
New commits: commit 54bb961b1e8c01603782f8e5c50e9e1ee5896d7c Author: Tamás Zolnai <tamas.zol...@collabora.com> AuthorDate: Fri Sep 13 15:59:54 2019 +0200 Commit: Tamás Zolnai <tamas.zol...@collabora.com> CommitDate: Wed Sep 25 12:20:29 2019 +0200 sc lok: Test invalidation triggered by PageDown Change-Id: Id54a679b60e440f17371a3a532928bd161077e90 Reviewed-on: https://gerrit.libreoffice.org/79487 Tested-by: Jenkins Reviewed-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 3a6e91ab9c51..9cb36f2d6133 100644 --- a/sc/qa/unit/tiledrendering/tiledrendering.cxx +++ b/sc/qa/unit/tiledrendering/tiledrendering.cxx @@ -37,6 +37,7 @@ #include <vcl/virdev.hxx> #include <vcl/unohelp2.hxx> #include <sc.hrc> +#include <comphelper/string.hxx> #include <chrono> #include <cstddef> @@ -98,6 +99,7 @@ public: void testFilterDlg(); void testVbaRangeCopyPaste(); void testInvalidationLoop(); + void testPageDownInvalidation(); CPPUNIT_TEST_SUITE(ScTiledRenderingTest); CPPUNIT_TEST(testRowColumnSelections); @@ -132,6 +134,7 @@ public: CPPUNIT_TEST(testFilterDlg); CPPUNIT_TEST(testVbaRangeCopyPaste); CPPUNIT_TEST(testInvalidationLoop); + CPPUNIT_TEST(testPageDownInvalidation); CPPUNIT_TEST_SUITE_END(); private: @@ -439,6 +442,7 @@ public: bool m_bGraphicViewSelection; bool m_bFullInvalidateTiles; bool m_bInvalidateTiles; + tools::Rectangle m_aInvalidation; bool m_bViewLock; OString m_sCellFormula; boost::property_tree::ptree m_aCommentCallbackResult; @@ -520,6 +524,15 @@ public: } else { + if (m_aInvalidation.IsEmpty()) + { + uno::Sequence<OUString> aSeq = comphelper::string::convertCommaSeparated(OUString::createFromAscii(pPayload)); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(4), aSeq.getLength()); + m_aInvalidation.setX(aSeq[0].toInt32()); + m_aInvalidation.setY(aSeq[1].toInt32()); + m_aInvalidation.setWidth(aSeq[2].toInt32()); + m_aInvalidation.setHeight(aSeq[3].toInt32()); + } m_bInvalidateTiles = true; } } @@ -1630,6 +1643,28 @@ void ScTiledRenderingTest::testInvalidationLoop() Scheduler::ProcessEventsToIdle(); } +void ScTiledRenderingTest::testPageDownInvalidation() +{ + 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_aInvalidation = tools::Rectangle(); + pModelObj->postKeyEvent(LOK_KEYEVENT_KEYINPUT, awt::Key::PAGEDOWN, 0); + pModelObj->postKeyEvent(LOK_KEYEVENT_KEYUP, awt::Key::PAGEDOWN, 0); + Scheduler::ProcessEventsToIdle(); + CPPUNIT_ASSERT(aView1.m_bInvalidateTiles); + CPPUNIT_ASSERT_EQUAL(tools::Rectangle(15, 15, 1230, 225), aView1.m_aInvalidation); +} + } CPPUNIT_TEST_SUITE_REGISTRATION(ScTiledRenderingTest); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits