From b2d70ac18e4f61b8bc68f0b091653a3a2992e0ab Mon Sep 17 00:00:00 2001 From: Szymon Kłos Date: Sat, 20 Jul 2019 11:07:56 +0100 Subject: Set clipboard for a window when created This allows to paste in dialogs input using tunneled context menu. Change-Id: Ie6cc6f1a6cd453734c8f6084b0bd50d1d7ab6c09 --- desktop/source/lib/init.cxx | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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("action", "") == "created") + { + VclPtr 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 xClipboard(xClip.get()); + pWindow->SetClipboard(xClipboard); + } } break; } -- cgit v1.2.3