diff options
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/window/window.cxx | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index 9ad12cf1e126..42e7af050f56 100644 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -8481,11 +8481,19 @@ uno::Reference< XClipboard > Window::GetClipboard() try { uno::Reference< XComponentContext > xContext( comphelper::getProcessComponentContext() ); - Reference<XSystemClipboard> xSystemClipboard; + Reference<XSystemClipboard> xSystemClipboard = SystemClipboard::createDefault(xContext); #if defined(UNX) && !defined(MACOSX) // unix clipboard needs to be initialized - xSystemClipboard = SystemClipboard::createUnix( xContext, Application::GetDisplayConnection(), "CLIPBOARD", vcl::createBmpConverter() ); -#else - xSystemClipboard = SystemClipboard::createDefault(xContext); + uno::Reference< XInitialization > xInit = uno::Reference< XInitialization >( xSystemClipboard, UNO_QUERY ); + + if( xInit.is() ) + { + Sequence< Any > aArgumentList( 3 ); + aArgumentList[ 0 ] = makeAny( Application::GetDisplayConnection() ); + aArgumentList[ 1 ] = makeAny( OUString("CLIPBOARD") ); + aArgumentList[ 2 ] = makeAny( vcl::createBmpConverter() ); + + xInit->initialize( aArgumentList ); + } #endif mpWindowImpl->mpFrameData->mxClipboard.set( xSystemClipboard, UNO_QUERY ); } |