diff options
author | Dennis Francis <dennis.francis@collabora.com> | 2019-03-29 18:34:22 +0530 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2019-04-03 12:15:44 +0200 |
commit | 01f5cc7c6a1467ec3a788ffb0fb29a6a64963578 (patch) | |
tree | eb8727be75b6c52e996a76625ee112fbcd431bfa /sc | |
parent | 70bfc2174cd5ac6678ecd43b0d325398e0320a03 (diff) |
tdf#120270 : ScUndoDragDrop - Notifying listeners of the area...
is not enough. This needs to be done recursively, ie notify the
listeners, notify the listeners of the listeners and so on.
ScDocument::BroadcastCells() seems to do exactly that, so lets
use it here intead of collect+notify.
Change-Id: Ifa273fea5f08af661958cd9b4c3d01d9044b8727
Reviewed-on: https://gerrit.libreoffice.org/70044
Reviewed-by: Dennis Francis <dennis.francis@collabora.com>
Tested-by: Dennis Francis <dennis.francis@collabora.com>
(cherry picked from commit 86ba9cdc69976d9cdb7d6ec1a527012647abf10d)
Reviewed-on: https://gerrit.libreoffice.org/70179
Tested-by: Jenkins
Reviewed-by: Eike Rathke <erack@redhat.com>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/ui/undo/undoblk.cxx | 28 |
1 files changed, 1 insertions, 27 deletions
diff --git a/sc/source/ui/undo/undoblk.cxx b/sc/source/ui/undo/undoblk.cxx index 4e982824e2ea..71e29b1ee357 100644 --- a/sc/source/ui/undo/undoblk.cxx +++ b/sc/source/ui/undo/undoblk.cxx @@ -1317,22 +1317,6 @@ void ScUndoDragDrop::DoUndo( ScRange aRange ) maPaintRanges.Join(aPaintRange); } -namespace { - -class DataChangeNotifier -{ - ScHint const maHint; -public: - DataChangeNotifier() : maHint(SfxHintId::ScDataChanged, ScAddress()) {} - - void operator() ( SvtListener* p ) - { - p->Notify(maHint); - } -}; - -} - void ScUndoDragDrop::Undo() { mnPaintExtFlags = 0; @@ -1385,17 +1369,7 @@ void ScUndoDragDrop::Undo() DoUndo(aDestRange); DoUndo(aSrcRange); - // Notify all area listeners whose listened areas are partially moved, to - // recalculate. - std::vector<SvtListener*> aListeners; - rDoc.CollectAllAreaListeners(aListeners, aSrcRange, sc::AreaPartialOverlap); - - // Remove any duplicate listener entries. We must ensure that we notify - // each unique listener only once. - std::sort(aListeners.begin(), aListeners.end()); - aListeners.erase(std::unique(aListeners.begin(), aListeners.end()), aListeners.end()); - - std::for_each(aListeners.begin(), aListeners.end(), DataChangeNotifier()); + rDoc.BroadcastCells(aSrcRange, SfxHintId::ScDataChanged, false); } else DoUndo(aDestRange); |