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

New commits:
commit ff0cd54de41e71e24bf7d833b1260c6dbb8dbfea
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: Wed Sep 25 12:21:14 2019 +0200

    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.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 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);
commit d877c232c0d63fd509fa8bf9ca433481dfb2b126
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: Wed Sep 25 12:20:52 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>

diff --git a/sc/qa/unit/tiledrendering/tiledrendering.cxx 
b/sc/qa/unit/tiledrendering/tiledrendering.cxx
index 9cb36f2d6133..9f1c0435108b 100644
--- a/sc/qa/unit/tiledrendering/tiledrendering.cxx
+++ b/sc/qa/unit/tiledrendering/tiledrendering.cxx
@@ -1009,9 +1009,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)
@@ -1023,9 +1025,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

Reply via email to