diff options
author | Caolán McNamara <caolanm@redhat.com> | 2021-06-01 11:40:11 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2021-06-01 15:27:20 +0200 |
commit | 2907f7d97a3dabe1179f0251791fcee336b26a22 (patch) | |
tree | 89d9d55ca4b5964c6d3881f6a916fb6eaeed21e5 /sd | |
parent | 29bd00f7628e7a54e69cabcc7e2a1792c24aa55c (diff) |
cid#1485150 Uncaught exception
remove the reported exception path from the dtor call
Change-Id: I438a9c3de41d516e1994aeb1509bb8ee333bf23f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116532
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sd')
-rw-r--r-- | sd/source/ui/inc/View.hxx | 6 | ||||
-rw-r--r-- | sd/source/ui/view/drviews1.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/view/sdview.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/view/sdview2.cxx | 29 |
4 files changed, 27 insertions, 12 deletions
diff --git a/sd/source/ui/inc/View.hxx b/sd/source/ui/inc/View.hxx index 68c09f547409..693e596d1084 100644 --- a/sd/source/ui/inc/View.hxx +++ b/sd/source/ui/inc/View.hxx @@ -131,7 +131,11 @@ public: css::uno::Reference<css::datatransfer::XTransferable> CreateSelectionDataObject (::sd::View*); - void UpdateSelectionClipboard( bool bForceDeselect ); + // update clipboard to what is selected + void UpdateSelectionClipboard(); + + // release content of clipboard, if we own the content + void ClearSelectionClipboard(); DrawDocShell* GetDocSh() const { return mpDocSh; } inline SdDrawDocument& GetDoc() const; diff --git a/sd/source/ui/view/drviews1.cxx b/sd/source/ui/view/drviews1.cxx index be985ede217a..6c1df14a3961 100644 --- a/sd/source/ui/view/drviews1.cxx +++ b/sd/source/ui/view/drviews1.cxx @@ -249,7 +249,7 @@ void DrawViewShell::SelectionHasChanged() // Invalidate for every subshell GetViewShellBase().GetViewShellManager()->InvalidateAllSubShells(this); - mpDrawView->UpdateSelectionClipboard( false ); + mpDrawView->UpdateSelectionClipboard(); GetViewShellBase().GetDrawController().FireSelectionChangeListener(); } diff --git a/sd/source/ui/view/sdview.cxx b/sd/source/ui/view/sdview.cxx index 32f9feac8d35..e2e0a053a47e 100644 --- a/sd/source/ui/view/sdview.cxx +++ b/sd/source/ui/view/sdview.cxx @@ -135,7 +135,7 @@ View::~View() maSmartTags.Dispose(); // release content of selection clipboard, if we own the content - UpdateSelectionClipboard( true ); + ClearSelectionClipboard(); maDropErrorIdle.Stop(); maDropInsertFileIdle.Stop(); diff --git a/sd/source/ui/view/sdview2.cxx b/sd/source/ui/view/sdview2.cxx index 69790987b299..ba1b2cc226d7 100644 --- a/sd/source/ui/view/sdview2.cxx +++ b/sd/source/ui/view/sdview2.cxx @@ -211,17 +211,28 @@ css::uno::Reference< css::datatransfer::XTransferable > View::CreateSelectionDat return pTransferable; } -void View::UpdateSelectionClipboard( bool bForceDeselect ) +void View::UpdateSelectionClipboard() // false case { - if( mpViewSh && mpViewSh->GetActiveWindow() ) + if (!mpViewSh) + return; + if (!mpViewSh->GetActiveWindow()) + return; + if (GetMarkedObjectList().GetMarkCount()) + CreateSelectionDataObject( this ); + else + ClearSelectionClipboard(); +} + +void View::ClearSelectionClipboard() // true case +{ + if (!mpViewSh) + return; + if (!mpViewSh->GetActiveWindow()) + return; + if (SD_MOD()->pTransferSelection && SD_MOD()->pTransferSelection->GetView() == this) { - if( !bForceDeselect && GetMarkedObjectList().GetMarkCount() ) - CreateSelectionDataObject( this ); - else if( SD_MOD()->pTransferSelection && ( SD_MOD()->pTransferSelection->GetView() == this ) ) - { - TransferableHelper::ClearPrimarySelection(); - SD_MOD()->pTransferSelection = nullptr; - } + TransferableHelper::ClearPrimarySelection(); + SD_MOD()->pTransferSelection = nullptr; } } |