summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2022-03-05 22:11:30 +0100
committerLuboš Luňák <l.lunak@collabora.com>2022-03-06 08:19:51 +0100
commit648a4b30b33569052847b797c38e52ba2fd2d500 (patch)
tree2ce30db4b37d739479f4a247408ab763e570cd1c /include
parent7ac19fbce8a35f559eebb879cd0f232bfc95e703 (diff)
do not destroy broadcasters and then recreate again (tdf#134268)
Sorting ends tells all listeners on all the sorted cells to end listening to stop updates, then sorts the cells and starts listening again. This will cause all broadcasters for the sorted cells to temporarily stop having any listeners, so they'll be deleted and removed from the mdds vector (which may additionally cause moving large parts of the mdds vector repeatedly). And since all listeners will want to listen again after the sort, this will all need to be reconstructed. To avoid this, temporarily block this removal and then later just checks and remove any possibly left-over broadcasters that ended up with no listeners. Change-Id: Ie2d41d9acd7b657cf31a445870ce7f18d28d5ebb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131069 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Diffstat (limited to 'include')
-rw-r--r--include/svl/broadcast.hxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/svl/broadcast.hxx b/include/svl/broadcast.hxx
index c1996ccfeda7..eaf4de8ba448 100644
--- a/include/svl/broadcast.hxx
+++ b/include/svl/broadcast.hxx
@@ -59,7 +59,7 @@ public:
ListenersType& GetAllListeners();
const ListenersType& GetAllListeners() const;
- bool HasListeners() const;
+ bool HasListeners() const { return (maListeners.size() - mnEmptySlots) > 0; }
/**
* Listeners and broadcasters are M:N relationship. If you want to