toolkit/source/awt/vclxtoolkit.cxx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
New commits: commit 5159ca63d3d5caf52a3218d9356400f542e66a0e Author: Michael Weghorn <[email protected]> AuthorDate: Fri Feb 27 19:08:11 2026 +0100 Commit: Michael Weghorn <[email protected]> CommitDate: Sat Feb 28 16:31:44 2026 +0100 toolkit: Use GetSystemClipboard() in VCLXToolkit ... instead of manually calling the SystemClipboard service ctor. Change-Id: Ic0b2943d7b06199303d34ea46c6863b8165aca6b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200655 Tested-by: Jenkins Reviewed-by: Michael Weghorn <[email protected]> diff --git a/toolkit/source/awt/vclxtoolkit.cxx b/toolkit/source/awt/vclxtoolkit.cxx index 8341369248ca..d2f584e2c3a6 100644 --- a/toolkit/source/awt/vclxtoolkit.cxx +++ b/toolkit/source/awt/vclxtoolkit.cxx @@ -37,6 +37,7 @@ #include <com/sun/star/awt/KeyEvent.hpp> #include <com/sun/star/awt/KeyModifier.hpp> #include <com/sun/star/lang/EventObject.hpp> +#include <com/sun/star/uno/DeploymentException.hpp> #include <com/sun/star/uno/Reference.hxx> #include <com/sun/star/uno/Sequence.hxx> #include <com/sun/star/uno/XComponentContext.hpp> @@ -44,7 +45,6 @@ #include <com/sun/star/beans/NamedValue.hpp> #include <com/sun/star/beans/XPropertyChangeListener.hpp> #include <com/sun/star/beans/XPropertySet.hpp> -#include <com/sun/star/datatransfer/clipboard/SystemClipboard.hpp> #include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/awt/XToolkitExperimental.hpp> #include <com/sun/star/awt/XToolkitRobot.hpp> @@ -63,6 +63,7 @@ #include <tools/link.hxx> #include <vcl/dndlistenercontainer.hxx> #include <vcl/idletask.hxx> +#include <vcl/transfer.hxx> #include <vcl/unohelp.hxx> #include <vcl/vclevent.hxx> #include <vcl/wintypes.hxx> @@ -2063,13 +2064,14 @@ css::uno::Reference< css::datatransfer::dnd::XDropTarget > SAL_CALL VCLXToolkit: css::uno::Reference< css::datatransfer::clipboard::XClipboard > SAL_CALL VCLXToolkit::getClipboard( const OUString& clipboardName ) { + SolarMutexGuard g; + if( clipboardName.isEmpty() ) { if( !mxClipboard.is() ) { // remember clipboard here - mxClipboard = css::datatransfer::clipboard::SystemClipboard::create( - comphelper::getProcessComponentContext()); + mxClipboard = GetSystemClipboard(); } return mxClipboard;
