diff options
author | Szymon Kłos <szymon.klos@collabora.com> | 2019-07-20 11:07:56 +0100 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2019-07-20 11:07:56 +0100 |
commit | b2d70ac18e4f61b8bc68f0b091653a3a2992e0ab (patch) | |
tree | 9bb81ca726c826a453c875d2f92ffe6efd0a2305 | |
parent | 5fc8f0d923ee85c6b9e1998bf769b96678f2e905 (diff) |
Set clipboard for a window when created
This allows to paste in dialogs input using tunneled context menu.
Change-Id: Ie6cc6f1a6cd453734c8f6084b0bd50d1d7ab6c09
-rw-r--r-- | desktop/source/lib/init.cxx | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 4c8f37804810..7562133b52c4 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -1437,6 +1437,20 @@ void CallbackFlushHandler::queue(const int type, const char* data) assert(aCallbackData.validate() && "Validation after setJson failed!"); } } + else if (aTree.get<std::string>("action", "") == "created") + { + VclPtr<Window> pWindow = vcl::Window::FindLOKWindow(nLOKWindowId); + if (!pWindow) + { + gImpl->maLastExceptionMsg = "Document doesn't support dialog rendering, or window not found."; + return; + } + + auto xClip = forceSetClipboardForCurrentView(m_pDocument); + + uno::Reference<datatransfer::clipboard::XClipboard> xClipboard(xClip.get()); + pWindow->SetClipboard(xClipboard); + } } break; } |