summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAshod Nakashian <ashod.nakashian@collabora.co.uk>2016-05-11 19:03:08 -0400
committerAshod Nakashian <ashnakash@gmail.com>2016-05-15 20:10:35 +0000
commita67deda358bc760504e66b3375cd5982b9f4fa27 (patch)
tree5c86684dd3a026e2118d0b487df302db8ee8d72f
parent6f857ead2e530c5d570f035a39cdcd3765ad4660 (diff)
Revert "LOK: simplify notification compression to minimize error"
Restoring back Some of the notification compression. This reverts commit 4bdff9b94b545aa966c44b54c21c23dd724382c0. Change-Id: I229911c63386b3668e8bd9541b48c80479cc2771 Reviewed-on: https://gerrit.libreoffice.org/25012 Reviewed-by: Ashod Nakashian <ashnakash@gmail.com> Tested-by: Ashod Nakashian <ashnakash@gmail.com>
-rw-r--r--desktop/inc/lib/init.hxx10
-rw-r--r--desktop/qa/desktop_lib/test_desktop_lib.cxx43
2 files changed, 30 insertions, 23 deletions
diff --git a/desktop/inc/lib/init.hxx b/desktop/inc/lib/init.hxx
index 415143dcc253..ae7a6707bb46 100644
--- a/desktop/inc/lib/init.hxx
+++ b/desktop/inc/lib/init.hxx
@@ -40,7 +40,17 @@ namespace desktop {
// Add the states that are safe to skip duplicates on,
// even when not consequent.
+ m_states.emplace(LOK_CALLBACK_TEXT_SELECTION_START, "NIL");
+ m_states.emplace(LOK_CALLBACK_TEXT_SELECTION_END, "NIL");
+ m_states.emplace(LOK_CALLBACK_TEXT_SELECTION, "NIL");
+ m_states.emplace(LOK_CALLBACK_GRAPHIC_SELECTION, "NIL");
+ 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 fbd88960ebed..13382acb4d56 100644
--- a/desktop/qa/desktop_lib/test_desktop_lib.cxx
+++ b/desktop/qa/desktop_lib/test_desktop_lib.cxx
@@ -815,33 +815,33 @@ void DesktopLOKTest::testNotificationCompression()
handler->queue(LOK_CALLBACK_INVALIDATE_TILES, "15 25 15 10"); // Superseeded.
handler->queue(LOK_CALLBACK_TEXT_SELECTION, "15 25 15 10"); // Should be dropped.
handler->queue(LOK_CALLBACK_TEXT_SELECTION, ""); // Superseeded.
- handler->queue(LOK_CALLBACK_STATE_CHANGED, ""); // 1
- handler->queue(LOK_CALLBACK_STATE_CHANGED, ".uno:Bold"); // 2
- handler->queue(LOK_CALLBACK_STATE_CHANGED, ""); // 3
- handler->queue(LOK_CALLBACK_MOUSE_POINTER, "text"); // Superseeded.
- handler->queue(LOK_CALLBACK_INVALIDATE_TILES, "15 25 15 10"); // 4
- handler->queue(LOK_CALLBACK_INVALIDATE_TILES, "15 25 15 10"); // Should be dropped.
+ handler->queue(LOK_CALLBACK_STATE_CHANGED, ""); // 2
+ handler->queue(LOK_CALLBACK_STATE_CHANGED, ".uno:Bold"); // 3
+ handler->queue(LOK_CALLBACK_STATE_CHANGED, ""); // 4
handler->queue(LOK_CALLBACK_MOUSE_POINTER, "text"); // 5
+ handler->queue(LOK_CALLBACK_INVALIDATE_TILES, "15 25 15 10"); // 6
+ handler->queue(LOK_CALLBACK_INVALIDATE_TILES, "15 25 15 10"); // Should be dropped.
+ handler->queue(LOK_CALLBACK_MOUSE_POINTER, "text"); // Should be dropped.
handler->queue(LOK_CALLBACK_TEXT_SELECTION_START, "15 25 15 10"); // Superseeded.
handler->queue(LOK_CALLBACK_TEXT_SELECTION_END, "15 25 15 10"); // Superseeded.
handler->queue(LOK_CALLBACK_TEXT_SELECTION, "15 25 15 10"); // Superseedd.
handler->queue(LOK_CALLBACK_TEXT_SELECTION_START, "15 25 15 10"); // Should be dropped.
handler->queue(LOK_CALLBACK_TEXT_SELECTION_END, "15 25 15 10"); // Should be dropped.
- handler->queue(LOK_CALLBACK_TEXT_SELECTION, ""); // 6
- handler->queue(LOK_CALLBACK_TEXT_SELECTION_START, "15 25 15 10"); // 7
- handler->queue(LOK_CALLBACK_TEXT_SELECTION_END, "15 25 15 10"); // 8
- handler->queue(LOK_CALLBACK_CELL_CURSOR, "15 25 15 10"); // 9
- handler->queue(LOK_CALLBACK_CURSOR_VISIBLE, ""); // Superseeded.
+ handler->queue(LOK_CALLBACK_TEXT_SELECTION, ""); // 7
+ handler->queue(LOK_CALLBACK_TEXT_SELECTION_START, "15 25 15 10"); // 8
+ handler->queue(LOK_CALLBACK_TEXT_SELECTION_END, "15 25 15 10"); // 9
+ handler->queue(LOK_CALLBACK_CELL_CURSOR, "15 25 15 10"); // 10
+ handler->queue(LOK_CALLBACK_CURSOR_VISIBLE, ""); // 11
handler->queue(LOK_CALLBACK_CELL_CURSOR, "15 25 15 10"); // Should be dropped.
- handler->queue(LOK_CALLBACK_CELL_FORMULA, "blah"); // Superseeded.
- handler->queue(LOK_CALLBACK_SET_PART, "1"); // 11
- handler->queue(LOK_CALLBACK_CURSOR_VISIBLE, ""); // 12
- handler->queue(LOK_CALLBACK_CELL_FORMULA, "blah"); // 13
- handler->queue(LOK_CALLBACK_SET_PART, "1"); // 14
+ handler->queue(LOK_CALLBACK_CELL_FORMULA, "blah"); // 12
+ handler->queue(LOK_CALLBACK_SET_PART, "1"); // 13
+ 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>(14), notifs.size());
+ CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(13), notifs.size());
size_t i = 0;
CPPUNIT_ASSERT_EQUAL((int)LOK_CALLBACK_INVALIDATE_VISIBLE_CURSOR, (int)std::get<0>(notifs[i]));
@@ -856,12 +856,12 @@ void DesktopLOKTest::testNotificationCompression()
CPPUNIT_ASSERT_EQUAL((int)LOK_CALLBACK_STATE_CHANGED, (int)std::get<0>(notifs[i]));
CPPUNIT_ASSERT_EQUAL(std::string(""), std::get<1>(notifs[i++]));
- CPPUNIT_ASSERT_EQUAL((int)LOK_CALLBACK_INVALIDATE_TILES, (int)std::get<0>(notifs[i]));
- CPPUNIT_ASSERT_EQUAL(std::string("15 25 15 10"), std::get<1>(notifs[i++]));
-
CPPUNIT_ASSERT_EQUAL((int)LOK_CALLBACK_MOUSE_POINTER, (int)std::get<0>(notifs[i]));
CPPUNIT_ASSERT_EQUAL(std::string("text"), std::get<1>(notifs[i++]));
+ CPPUNIT_ASSERT_EQUAL((int)LOK_CALLBACK_INVALIDATE_TILES, (int)std::get<0>(notifs[i]));
+ CPPUNIT_ASSERT_EQUAL(std::string("15 25 15 10"), std::get<1>(notifs[i++]));
+
CPPUNIT_ASSERT_EQUAL((int)LOK_CALLBACK_TEXT_SELECTION, (int)std::get<0>(notifs[i]));
CPPUNIT_ASSERT_EQUAL(std::string(""), std::get<1>(notifs[i++]));
@@ -874,9 +874,6 @@ void DesktopLOKTest::testNotificationCompression()
CPPUNIT_ASSERT_EQUAL((int)LOK_CALLBACK_CELL_CURSOR, (int)std::get<0>(notifs[i]));
CPPUNIT_ASSERT_EQUAL(std::string("15 25 15 10"), std::get<1>(notifs[i++]));
- CPPUNIT_ASSERT_EQUAL((int)LOK_CALLBACK_SET_PART, (int)std::get<0>(notifs[i]));
- CPPUNIT_ASSERT_EQUAL(std::string("1"), std::get<1>(notifs[i++]));
-
CPPUNIT_ASSERT_EQUAL((int)LOK_CALLBACK_CURSOR_VISIBLE, (int)std::get<0>(notifs[i]));
CPPUNIT_ASSERT_EQUAL(std::string(""), std::get<1>(notifs[i++]));