diff options
author | Luboš Luňák <l.lunak@collabora.com> | 2022-03-05 22:11:30 +0100 |
---|---|---|
committer | Luboš Luňák <l.lunak@collabora.com> | 2022-03-06 08:19:51 +0100 |
commit | 648a4b30b33569052847b797c38e52ba2fd2d500 (patch) | |
tree | 2ce30db4b37d739479f4a247408ab763e570cd1c /svl/source/notify | |
parent | 7ac19fbce8a35f559eebb879cd0f232bfc95e703 (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 'svl/source/notify')
-rw-r--r-- | svl/source/notify/broadcast.cxx | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/svl/source/notify/broadcast.cxx b/svl/source/notify/broadcast.cxx index 6c75e0f464c1..54373115c9db 100644 --- a/svl/source/notify/broadcast.cxx +++ b/svl/source/notify/broadcast.cxx @@ -173,7 +173,7 @@ void SvtBroadcaster::Remove( SvtListener* p ) --mnListenersFirstUnsorted; } - if (maListeners.size() - mnEmptySlots == 0) + if (!HasListeners()) ListenersGone(); } @@ -252,11 +252,6 @@ const SvtBroadcaster::ListenersType& SvtBroadcaster::GetAllListeners() const return maListeners; } -bool SvtBroadcaster::HasListeners() const -{ - return (maListeners.size() - mnEmptySlots) > 0; -} - void SvtBroadcaster::PrepareForDestruction() { mbAboutToDie = true; |