[Libreoffice-commits] core.git: sc/qa
Tamás Zolnai (via logerrit)
logerrit at kemper.freedesktop.org
Wed Sep 25 10:33:29 UTC 2019
sc/qa/unit/tiledrendering/tiledrendering.cxx | 45 +++++++++++++++++++++++++++
1 file changed, 45 insertions(+)
New commits:
commit 9c975823b82e6b64c3dff0b4347162e8d426b852
Author: Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Sat Sep 21 15:46:38 2019 +0200
Commit: Tamás Zolnai <tamas.zolnai at collabora.com>
CommitDate: Wed Sep 25 12:32:27 2019 +0200
sc lok: Test invalidation triggered by getRowColumnHeaders() method
Change-Id: Ie9961688333b3ddd10562d62606dfe01b173534d
Reviewed-on: https://gerrit.libreoffice.org/79493
Tested-by: Jenkins
Reviewed-by: Tamás Zolnai <tamas.zolnai at collabora.com>
diff --git a/sc/qa/unit/tiledrendering/tiledrendering.cxx b/sc/qa/unit/tiledrendering/tiledrendering.cxx
index 5c6d74541c81..a22cca344966 100644
--- a/sc/qa/unit/tiledrendering/tiledrendering.cxx
+++ b/sc/qa/unit/tiledrendering/tiledrendering.cxx
@@ -102,6 +102,7 @@ public:
void testPageDownInvalidation();
void testSheetChangeInvalidation();
void testInsertDeletePageInvalidation();
+ void testGetRowColumnHeadersInvalidation();
CPPUNIT_TEST_SUITE(ScTiledRenderingTest);
CPPUNIT_TEST(testRowColumnSelections);
@@ -139,6 +140,7 @@ public:
CPPUNIT_TEST(testPageDownInvalidation);
CPPUNIT_TEST(testSheetChangeInvalidation);
CPPUNIT_TEST(testInsertDeletePageInvalidation);
+ CPPUNIT_TEST(testGetRowColumnHeadersInvalidation);
CPPUNIT_TEST_SUITE_END();
private:
@@ -1741,6 +1743,49 @@ void ScTiledRenderingTest::testInsertDeletePageInvalidation()
CPPUNIT_ASSERT_EQUAL(1, pModelObj->getParts());
}
+void ScTiledRenderingTest::testGetRowColumnHeadersInvalidation()
+{
+ 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_aInvalidations.clear();
+ pModelObj->getRowColumnHeaders(tools::Rectangle(0, 15, 19650, 5400));
+ 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, 49725, 13005), aView1.m_aInvalidations[1]);
+
+ // Extend area top-to-bottom
+ aView1.m_bInvalidateTiles = false;
+ aView1.m_aInvalidations.clear();
+ pModelObj->getRowColumnHeaders(tools::Rectangle(0, 5400, 19650, 9800));
+ 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, 49725, 19380), aView1.m_aInvalidations[1]);
+
+ // Extend area left-to-right
+ aView1.m_bInvalidateTiles = false;
+ aView1.m_aInvalidations.clear();
+ pModelObj->getRowColumnHeaders(tools::Rectangle(5400, 5400, 25050, 9800));
+ 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(49725, 0, 75225, 19380), aView1.m_aInvalidations[1]);
+}
+
}
CPPUNIT_TEST_SUITE_REGISTRATION(ScTiledRenderingTest);
More information about the Libreoffice-commits
mailing list