summaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
authorAshod Nakashian <ashod.nakashian@collabora.co.uk>2016-04-30 10:55:23 -0400
committerAshod Nakashian <ashnakash@gmail.com>2016-05-01 15:04:45 +0000
commita9771e1f4d0d2602713983ab1f3e743784e9ae72 (patch)
tree76a3562a598780d59f0e33357c7177e12fc4bb64 /desktop
parentf78ab21b687a7418f73d95e73d63bfda45f3f6e2 (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>
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 c9e0ff53b9f5..8ef92b142653 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 1199fe7066c6..9527acb65bfc 100644
--- a/desktop/qa/desktop_lib/test_desktop_lib.cxx
+++ b/desktop/qa/desktop_lib/test_desktop_lib.cxx
@@ -709,10 +709,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.
flushTimers();
- 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]));
@@ -758,6 +766,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);