From 19b6115e3edc62f0ccd1449a28d368f23698624d Mon Sep 17 00:00:00 2001 From: Ashod Nakashian Date: Sun, 5 May 2019 12:36:09 -0400 Subject: LOK: remove duplicate cursor invalidations for same view only This limits duplicate cursor invalidation removal to same view only, which seems to have been left in error. We should now remove any old cursor invalidations (for the same view) and only keep the latest (current) one. Change-Id: Ie2323d0c5fcf3977576a1bdc098c95351a5753e0 Reviewed-on: https://gerrit.libreoffice.org/71846 Reviewed-by: Jan Holesovsky Tested-by: Jan Holesovsky (cherry picked from commit 8e9c36dfc346387abfbbaefbc15a518cbe3e257c) Reviewed-on: https://gerrit.libreoffice.org/76286 Tested-by: Jenkins Reviewed-by: Noel Grandin --- desktop/source/lib/init.cxx | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) (limited to 'desktop') diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index a1487e3790da..7d497f031013 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -945,8 +945,8 @@ CallbackFlushHandler::CallbackFlushHandler(LibreOfficeKitDocument* pDocument, Li { SetPriority(TaskPriority::POST_PAINT); - // Add the states that are safe to skip duplicates on, - // even when not consequent. + // Add the states that are safe to skip duplicates on, even when + // not consequent (i.e. do no emmit them if unchanged from last). 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"); @@ -1038,7 +1038,7 @@ void CallbackFlushHandler::queue(const int type, const char* data) case LOK_CALLBACK_GRAPHIC_SELECTION: case LOK_CALLBACK_GRAPHIC_VIEW_SELECTION: case LOK_CALLBACK_INVALIDATE_VISIBLE_CURSOR: - case LOK_CALLBACK_INVALIDATE_VIEW_CURSOR : + case LOK_CALLBACK_INVALIDATE_VIEW_CURSOR: case LOK_CALLBACK_STATE_CHANGED: case LOK_CALLBACK_MOUSE_POINTER: case LOK_CALLBACK_CELL_CURSOR: @@ -1122,6 +1122,7 @@ void CallbackFlushHandler::queue(const int type, const char* data) case LOK_CALLBACK_CELL_VIEW_CURSOR: case LOK_CALLBACK_GRAPHIC_VIEW_SELECTION: case LOK_CALLBACK_INVALIDATE_VIEW_CURSOR: + case LOK_CALLBACK_INVALIDATE_VISIBLE_CURSOR: case LOK_CALLBACK_TEXT_VIEW_SELECTION: case LOK_CALLBACK_VIEW_CURSOR_VISIBLE: { @@ -1134,16 +1135,6 @@ void CallbackFlushHandler::queue(const int type, const char* data) } break; - case LOK_CALLBACK_INVALIDATE_VISIBLE_CURSOR: - { - removeAll( - [type, &payload] (const queue_type::value_type& elem) { - return (elem.Type == type && elem.PayloadString == payload); - } - ); - } - break; - case LOK_CALLBACK_INVALIDATE_TILES: { RectangleAndPart& rcNew = aCallbackData.setRectangleAndPart(payload); -- cgit