summaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
authorAshod Nakashian <ashod.nakashian@collabora.co.uk>2016-04-30 10:55:23 -0400
committerJan Holesovsky <kendy@collabora.com>2016-05-09 13:58:28 +0200
commit840e979757d7d9d7104f54269271c617b9b8d473 (patch)
tree0d347bdf1429d6cad7943ec9200e614a854509b3 /desktop
parentf2361df4b60172a3067073b20786afcf215bd588 (diff)
More LOK callback notification compression
SET_PART, CELL_CURSOR, CELL_FORMULA, and CURSOR_VISIBLE are now deduplicated. Change-Id: I4c17307c6f8b7c68bdfe55b4e90da4d34c55d085 Reviewed-on: https://gerrit.libreoffice.org/24565 Reviewed-by: Ashod Nakashian <ashnakash@gmail.com> Tested-by: Ashod Nakashian <ashnakash@gmail.com> (cherry picked from commit a9771e1f4d0d2602713983ab1f3e743784e9ae72)
Diffstat (limited to 'desktop')
-rw-r--r--desktop/inc/lib/init.hxx4
-rw-r--r--desktop/qa/desktop_lib/test_desktop_lib.cxx22
2 files changed, 25 insertions, 1 deletions
diff --git a/desktop/inc/lib/init.hxx b/desktop/inc/lib/init.hxx
index 7cf81e33b629..6206f056987f 100644
--- a/desktop/inc/lib/init.hxx
+++ b/desktop/inc/lib/init.hxx
@@ -45,6 +45,10 @@ namespace desktop {
m_states.emplace(LOK_CALLBACK_INVALIDATE_VISIBLE_CURSOR, "NIL");
m_states.emplace(LOK_CALLBACK_STATE_CHANGED, "NIL");
m_states.emplace(LOK_CALLBACK_MOUSE_POINTER, "NIL");
+ m_states.emplace(LOK_CALLBACK_CELL_CURSOR, "NIL");
+ m_states.emplace(LOK_CALLBACK_CELL_FORMULA, "NIL");
+ m_states.emplace(LOK_CALLBACK_CURSOR_VISIBLE, "NIL");
+ m_states.emplace(LOK_CALLBACK_SET_PART, "NIL");
Start();
}
diff --git a/desktop/qa/desktop_lib/test_desktop_lib.cxx b/desktop/qa/desktop_lib/test_desktop_lib.cxx
index 6beb0e7696ed..7f1d97ba73e7 100644
--- a/desktop/qa/desktop_lib/test_desktop_lib.cxx
+++ b/desktop/qa/desktop_lib/test_desktop_lib.cxx
@@ -1297,10 +1297,18 @@ void DesktopLOKTest::testNotificationCompression()
handler->queue(LOK_CALLBACK_TEXT_SELECTION, ""); // 12
handler->queue(LOK_CALLBACK_TEXT_SELECTION_START, "15 25 15 10"); // 13
handler->queue(LOK_CALLBACK_TEXT_SELECTION_END, "15 25 15 10"); // 14
+ handler->queue(LOK_CALLBACK_CELL_CURSOR, "15 25 15 10"); // 15
+ handler->queue(LOK_CALLBACK_CURSOR_VISIBLE, ""); // 16
+ handler->queue(LOK_CALLBACK_CELL_CURSOR, "15 25 15 10"); // Should be dropped.
+ handler->queue(LOK_CALLBACK_CELL_FORMULA, "blah"); // 17
+ handler->queue(LOK_CALLBACK_SET_PART, "1"); // 18
+ handler->queue(LOK_CALLBACK_CURSOR_VISIBLE, ""); // Should be dropped.
+ handler->queue(LOK_CALLBACK_CELL_FORMULA, "blah"); // Should be dropped.
+ handler->queue(LOK_CALLBACK_SET_PART, "1"); // Should be dropped.
Scheduler::ProcessEventsToIdle();
- CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(15), notifs.size());
+ CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(19), notifs.size());
CPPUNIT_ASSERT_EQUAL((int)LOK_CALLBACK_INVALIDATE_VISIBLE_CURSOR, (int)std::get<0>(notifs[0]));
CPPUNIT_ASSERT_EQUAL(std::string(""), std::get<1>(notifs[0]));
@@ -1346,6 +1354,18 @@ void DesktopLOKTest::testNotificationCompression()
CPPUNIT_ASSERT_EQUAL((int)LOK_CALLBACK_TEXT_SELECTION_END, (int)std::get<0>(notifs[14]));
CPPUNIT_ASSERT_EQUAL(std::string("15 25 15 10"), std::get<1>(notifs[14]));
+
+ CPPUNIT_ASSERT_EQUAL((int)LOK_CALLBACK_CELL_CURSOR, (int)std::get<0>(notifs[15]));
+ CPPUNIT_ASSERT_EQUAL(std::string("15 25 15 10"), std::get<1>(notifs[15]));
+
+ CPPUNIT_ASSERT_EQUAL((int)LOK_CALLBACK_CURSOR_VISIBLE, (int)std::get<0>(notifs[16]));
+ CPPUNIT_ASSERT_EQUAL(std::string(""), std::get<1>(notifs[16]));
+
+ CPPUNIT_ASSERT_EQUAL((int)LOK_CALLBACK_CELL_FORMULA, (int)std::get<0>(notifs[17]));
+ CPPUNIT_ASSERT_EQUAL(std::string("blah"), std::get<1>(notifs[17]));
+
+ CPPUNIT_ASSERT_EQUAL((int)LOK_CALLBACK_SET_PART, (int)std::get<0>(notifs[18]));
+ CPPUNIT_ASSERT_EQUAL(std::string("1"), std::get<1>(notifs[18]));
}
CPPUNIT_TEST_SUITE_REGISTRATION(DesktopLOKTest);