[Libreoffice-commits] online.git: wsd/SenderQueue.hpp

Ashod Nakashian ashod.nakashian at collabora.co.uk
Mon Dec 19 06:02:42 UTC 2016


 wsd/SenderQueue.hpp |   16 ++++++++++++++++
 1 file changed, 16 insertions(+)

New commits:
commit 2b9e695a3be4f009b954e0891821ccb9ff53420a
Author: Ashod Nakashian <ashod.nakashian at collabora.co.uk>
Date:   Sun Dec 18 17:48:44 2016 -0500

    wsd: deduplicate more messages
    
    Change-Id: I0ad9ef7bf826b3fd0eba9cc17ec5212a3334a2f5
    Reviewed-on: https://gerrit.libreoffice.org/32163
    Reviewed-by: Ashod Nakashian <ashnakash at gmail.com>
    Tested-by: Ashod Nakashian <ashnakash at gmail.com>

diff --git a/wsd/SenderQueue.hpp b/wsd/SenderQueue.hpp
index 3c42264..fd452bf 100644
--- a/wsd/SenderQueue.hpp
+++ b/wsd/SenderQueue.hpp
@@ -211,6 +211,22 @@ private:
                 _queue.erase(pos);
             }
         }
+        else if (command == "statusindicatorsetvalue:" ||
+                 command == "invalidatecursor:")
+        {
+            // Remove previous identical enties of this command,
+            // if any, and use most recent (incoming).
+            const auto& pos = std::find_if(_queue.begin(), _queue.end(),
+                [&command](const queue_item_t& cur)
+                {
+                    return (cur->firstToken() == command);
+                });
+
+            if (pos != _queue.end())
+            {
+                _queue.erase(pos);
+            }
+        }
         else if (command == "invalidateviewcursor:")
         {
             // Remove previous cursor invalidation for same view,


More information about the Libreoffice-commits mailing list