[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.0' - sc/qa

Tamás Zolnai (via logerrit) logerrit at kemper.freedesktop.org
Sat Sep 28 01:30:44 UTC 2019


 sc/qa/unit/tiledrendering/data/two_sheets.ods |binary
 sc/qa/unit/tiledrendering/tiledrendering.cxx  |   25 +++++++++++++++++++++++++
 2 files changed, 25 insertions(+)

New commits:
commit 6d29c06e17e2a7ab1efd30108350f785f2a1ee0e
Author:     Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Fri Sep 13 17:44:36 2019 +0200
Commit:     Tamás Zolnai <tamas.zolnai at collabora.com>
CommitDate: Sat Sep 28 03:30:08 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.zolnai at collabora.com>
    (cherry picked from commit ff0cd54de41e71e24bf7d833b1260c6dbb8dbfea)
    
    Change-Id: I799089fc65d92fe72d7e76afbcd44bd4161d25f4
    Reviewed-on: https://gerrit.libreoffice.org/79615
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Tamás Zolnai <tamas.zolnai at collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/79758

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 db524665e86c..3276ce901dcc 100644
--- a/sc/qa/unit/tiledrendering/tiledrendering.cxx
+++ b/sc/qa/unit/tiledrendering/tiledrendering.cxx
@@ -100,6 +100,7 @@ public:
     void testFilterDlg();
     void testVbaRangeCopyPaste();
     void testPageDownInvalidation();
+    void testSheetChangeInvalidation();
 
     CPPUNIT_TEST_SUITE(ScTiledRenderingTest);
     CPPUNIT_TEST(testRowColumnSelections);
@@ -134,6 +135,7 @@ public:
     CPPUNIT_TEST(testFilterDlg);
     CPPUNIT_TEST(testVbaRangeCopyPaste);
     CPPUNIT_TEST(testPageDownInvalidation);
+    CPPUNIT_TEST(testSheetChangeInvalidation);
     CPPUNIT_TEST_SUITE_END();
 
 private:
@@ -1704,6 +1706,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);


More information about the Libreoffice-commits mailing list