vcl/source/treelist/transfer2.cxx | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)
New commits: commit 88ba87ae4f6a321d9affc8d3be865e1bffa0df92 Author: Michael Weghorn <[email protected]> AuthorDate: Fri Feb 27 18:37:20 2026 +0100 Commit: Michael Weghorn <[email protected]> CommitDate: Sat Feb 28 09:36:29 2026 +0100 vcl: Don't use UNO service ctor in GetSystemClipboard Similar to how Change-Id: I28f83f22a5826484327b91bcfd5a4c6650dc72de Author: Michael Weghorn <[email protected]> Date: Fri Feb 27 18:23:31 2026 +0100 vcl: Replace hack to pass extra service ctor param for primary selection did in GetSystemPrimarySelection, also use SalInstance::CreateClipboard directly in GetSystemClipboard, at least for the non-Windows case. (Windows is special due to using a single-instance service, see comment at the beginning of the function.) Change-Id: I6f15ab7ab9f1dcf08d84eddec84855020af7ba61 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200648 Reviewed-by: Michael Weghorn <[email protected]> Tested-by: Jenkins diff --git a/vcl/source/treelist/transfer2.cxx b/vcl/source/treelist/transfer2.cxx index b3cef35b3729..207db508d75c 100644 --- a/vcl/source/treelist/transfer2.cxx +++ b/vcl/source/treelist/transfer2.cxx @@ -462,9 +462,8 @@ Reference<XClipboard> GetSystemClipboard() // On Windows, the css.datatransfer.clipboard.SystemClipboard UNO service is implemented as a // single-instance service (dtrans_CWinClipboard_get_implementation in // vcl/win/dtrans/WinClipboard.cxx) that needs timely disposing to join a spawned thread - // (done in DeInitVCL, vcl/source/app/svmain.cxx), while on other platforms it is implemented as - // a multi-instance service (ClipboardFactory, vcl/source/components/dtranscomp.cxx) so we - // should not hold on to a single instance here: + // (done in DeInitVCL, vcl/source/app/svmain.cxx), while on other platforms multiple instances + // are used, so we should not hold on to a single instance here: #if defined _WIN32 DBG_TESTSOLARMUTEX(); auto const data = ImplGetSVData(); @@ -494,8 +493,7 @@ Reference<XClipboard> GetSystemClipboard() #endif else { - xClipboard = css::datatransfer::clipboard::SystemClipboard::create( - comphelper::getProcessComponentContext()); + xClipboard = GetSalInstance()->CreateClipboard(ClipboardSelectionType::Clipboard); } } catch (DeploymentException const &) {}
