diff options
author | Caolán McNamara <caolanm@redhat.com> | 2022-05-14 16:27:46 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2022-05-14 19:17:03 +0200 |
commit | dba12ec9cf049812dfadade3ed6a84127a9dca6c (patch) | |
tree | 69c8821c280dfe6e3dc461908babd5fc06d76174 /editeng | |
parent | 22e08a3d8b043ce0ff2424d3fa0a704804afc567 (diff) |
tdf#149079 don't skip disposing DnDListener
even if there is no longer a DropTarget don't return early and
omit to inform listeners of the disposing
Change-Id: I6ce7fe1664049a9e0a88b549b1c8c94ec8072c1f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134322
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'editeng')
-rw-r--r-- | editeng/source/editeng/impedit.cxx | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/editeng/source/editeng/impedit.cxx b/editeng/source/editeng/impedit.cxx index d43e3053489f..b2ce6d198752 100644 --- a/editeng/source/editeng/impedit.cxx +++ b/editeng/source/editeng/impedit.cxx @@ -2693,18 +2693,18 @@ void ImpEditView::RemoveDragAndDropListeners() else if (auto xWindow = GetWindow()) xDropTarget = xWindow->GetDropTarget(); - if (!xDropTarget.is()) - return; - - css::uno::Reference<css::datatransfer::dnd::XDragGestureRecognizer> xDragGestureRecognizer(xDropTarget, uno::UNO_QUERY); - if (xDragGestureRecognizer.is()) + if (xDropTarget.is()) { - uno::Reference<datatransfer::dnd::XDragGestureListener> xDGL(mxDnDListener, uno::UNO_QUERY); - xDragGestureRecognizer->removeDragGestureListener(xDGL); - } + css::uno::Reference<css::datatransfer::dnd::XDragGestureRecognizer> xDragGestureRecognizer(xDropTarget, uno::UNO_QUERY); + if (xDragGestureRecognizer.is()) + { + uno::Reference<datatransfer::dnd::XDragGestureListener> xDGL(mxDnDListener, uno::UNO_QUERY); + xDragGestureRecognizer->removeDragGestureListener(xDGL); + } - uno::Reference<datatransfer::dnd::XDropTargetListener> xDTL(mxDnDListener, uno::UNO_QUERY); - xDropTarget->removeDropTargetListener(xDTL); + uno::Reference<datatransfer::dnd::XDropTargetListener> xDTL(mxDnDListener, uno::UNO_QUERY); + xDropTarget->removeDropTargetListener(xDTL); + } if ( mxDnDListener.is() ) { |