diff options
author | Jan-Marek Glogowski <glogow@fbihome.de> | 2019-07-09 20:29:05 +0000 |
---|---|---|
committer | Jan-Marek Glogowski <glogow@fbihome.de> | 2019-07-10 17:51:43 +0200 |
commit | f8f43e55ec4ae7e436a5043fe6f4bae7b39cc6ad (patch) | |
tree | 592bcb60a7861d0ab4f17fabeca822c8c635d092 /editeng | |
parent | 70c80d626493828cc40227de4cdcfb1842356069 (diff) |
tdf#126316 revert Clipboard to PrimarySelection
Regression from commit ce9795954d39 ("fix crash in header/footer
calc dialog"), which replaced some GetPrimarySelection() calls
with GetClipboard() calls.
This replaces the Window class calls for clipboard with global
GetSystem* calls in vcl/transfer.hxx. Not sure if this is the
best place, but the crowded Window class is definitly not.
Change-Id: Ic5f9e575c1ac5d43df234426c5616eca616dea30
Reviewed-on: https://gerrit.libreoffice.org/75318
Tested-by: Jenkins
Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
Diffstat (limited to 'editeng')
-rw-r--r-- | editeng/source/editeng/impedit.cxx | 13 | ||||
-rw-r--r-- | editeng/source/editeng/impedit.hxx | 1 |
2 files changed, 11 insertions, 3 deletions
diff --git a/editeng/source/editeng/impedit.cxx b/editeng/source/editeng/impedit.cxx index 15937acb1cf2..15a25c4cdd68 100644 --- a/editeng/source/editeng/impedit.cxx +++ b/editeng/source/editeng/impedit.cxx @@ -1279,7 +1279,14 @@ Reference<css::datatransfer::clipboard::XClipboard> ImpEditView::GetClipboard() { if (vcl::Window* pWindow = GetWindow()) return pWindow->GetClipboard(); - return css::datatransfer::clipboard::SystemClipboard::create(comphelper::getProcessComponentContext()); + return GetSystemClipboard(); +} + +Reference<css::datatransfer::clipboard::XClipboard> ImpEditView::GetSelection() +{ + if (vcl::Window* pWindow = GetWindow()) + return pWindow->GetPrimarySelection(); + return GetSystemPrimarySelection(); } bool ImpEditView::PostKeyEvent( const KeyEvent& rKeyEvent, vcl::Window const * pFrameWin ) @@ -1343,12 +1350,12 @@ bool ImpEditView::MouseButtonUp( const MouseEvent& rMouseEvent ) if ( rMouseEvent.IsMiddle() && !bReadOnly && ( pWindow->GetSettings().GetMouseSettings().GetMiddleButtonAction() == MouseMiddleButtonAction::PasteSelection ) ) { - Reference<css::datatransfer::clipboard::XClipboard> aClipBoard(GetClipboard()); + Reference<css::datatransfer::clipboard::XClipboard> aClipBoard(GetSelection()); Paste( aClipBoard ); } else if ( rMouseEvent.IsLeft() && GetEditSelection().HasRange() ) { - Reference<css::datatransfer::clipboard::XClipboard> aClipBoard(GetClipboard()); + Reference<css::datatransfer::clipboard::XClipboard> aClipBoard(GetSelection()); CutCopy( aClipBoard, false ); } } diff --git a/editeng/source/editeng/impedit.hxx b/editeng/source/editeng/impedit.hxx index b7f7d5db0323..0ef1130322c0 100644 --- a/editeng/source/editeng/impedit.hxx +++ b/editeng/source/editeng/impedit.hxx @@ -283,6 +283,7 @@ private: void InvalidateAtWindow(const tools::Rectangle& rRect); css::uno::Reference<css::datatransfer::clipboard::XClipboard> GetClipboard(); + css::uno::Reference<css::datatransfer::clipboard::XClipboard> GetSelection(); protected: |