diff options
-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; } } |