diff options
author | Ashod Nakashian <ashod.nakashian@collabora.co.uk> | 2016-04-23 14:06:22 -0400 |
---|---|---|
committer | Ashod Nakashian <ashnakash@gmail.com> | 2016-05-09 02:40:38 +0000 |
commit | 3d27afd26f7b85c46a7c7d08498000b9dbcea1c8 (patch) | |
tree | 6d0db56701fe588ea7eec64ac3db3bf835219a56 /desktop/inc | |
parent | 0ab7ad3bb0138c2614f66dba8af39cabe760f910 (diff) |
Desktop compresses text selection start/end notifications
Change-Id: Ia85ded04d0eaf9d9b846fab6d86a44a758fccb69
Reviewed-on: https://gerrit.libreoffice.org/24320
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
(cherry picked from commit 45037438d84485356a5ceb820ecc3e0bae4b112e)
Reviewed-on: https://gerrit.libreoffice.org/24380
Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'desktop/inc')
-rw-r--r-- | desktop/inc/lib/init.hxx | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/desktop/inc/lib/init.hxx b/desktop/inc/lib/init.hxx index df065d767dca..7cf81e33b629 100644 --- a/desktop/inc/lib/init.hxx +++ b/desktop/inc/lib/init.hxx @@ -39,6 +39,8 @@ 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_INVALIDATE_VISIBLE_CURSOR, "NIL"); m_states.emplace(LOK_CALLBACK_STATE_CHANGED, "NIL"); @@ -94,6 +96,13 @@ namespace desktop { return; } + if (type == LOK_CALLBACK_TEXT_SELECTION && payload.empty()) + { + // Removing text selection invalidates the start and end as well. + m_states[LOK_CALLBACK_TEXT_SELECTION_START] = ""; + m_states[LOK_CALLBACK_TEXT_SELECTION_END] = ""; + } + m_queue.emplace_back(type, payload); lock.unlock(); |