vcl/jsdialog/jsdialogbuilder.cxx | 12 ++++++++++++ 1 file changed, 12 insertions(+)
New commits: commit e64784c4e8775d0c831ad71c70e73854a4b9aaa4 Author: Szymon Kłos <szymon.k...@collabora.com> AuthorDate: Wed Jan 20 17:48:18 2021 +0100 Commit: Szymon Kłos <szymon.k...@collabora.com> CommitDate: Thu Jan 21 07:53:42 2021 +0100 jsdialog: don't send multiple updates with the same content Change-Id: I601511a85386a8a35cbc6a121a4719928f585794 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109726 Tested-by: Jenkins Reviewed-by: Szymon Kłos <szymon.k...@collabora.com> diff --git a/vcl/jsdialog/jsdialogbuilder.cxx b/vcl/jsdialog/jsdialogbuilder.cxx index e8c8ff4d4232..836c73f3edea 100644 --- a/vcl/jsdialog/jsdialogbuilder.cxx +++ b/vcl/jsdialog/jsdialogbuilder.cxx @@ -68,6 +68,18 @@ void JSDialogNotifyIdle::send(tools::JsonWriter& aJsonWriter) void JSDialogNotifyIdle::sendMessage(jsdialog::MessageType eType, VclPtr<vcl::Window> pWindow) { + // we want only the latest update of same type + // TODO: also if we met full update - previous updates are not valid + auto it = m_aMessageQueue.begin(); + + while (it != m_aMessageQueue.end()) + { + if (it->first == eType && it->second == pWindow) + it = m_aMessageQueue.erase(it); + else + it++; + } + m_aMessageQueue.push_back(std::make_pair(eType, pWindow)); } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits