a11y tests: Don't use SystemClipboard service ctor

Instead of going via this UNO abstraction, call
GetSystemClipboard() to get access to the system
clipboard.

Change-Id: I8ef1d7b0c76b3a154ff8b1bddeed0a0ad57f5709
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200653
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
This commit is contained in:
Michael Weghorn
2026-02-28 09:41:36 +01:00
parent a53c360a82
commit c60458d60e
+2 -4
View File
@@ -23,11 +23,11 @@
#include <com/sun/star/accessibility/XAccessibleComponent.hpp>
#include <com/sun/star/accessibility/XAccessibleContext.hpp>
#include <com/sun/star/awt/Point.hpp>
#include <com/sun/star/datatransfer/clipboard/SystemClipboard.hpp>
#include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
#include <com/sun/star/uno/Reference.hxx>
#include <comphelper/processfactory.hxx>
#include <tools/color.hxx>
#include <vcl/transfer.hxx>
#include <vcl/unohelp.hxx>
#include <test/a11y/AccessibilityTools.hxx>
#include <test/a11y/XAccessibleTextTester.hxx>
@@ -587,9 +587,7 @@ void XAccessibleTextTester::testCopyText()
OUString XAccessibleTextTester::getSystemClipboardText()
{
css::uno::Reference<css::datatransfer::clipboard::XSystemClipboard> xClipboard
= css::datatransfer::clipboard::SystemClipboard::create(
comphelper::getProcessComponentContext());
css::uno::Reference<css::datatransfer::clipboard::XClipboard> xClipboard = GetSystemClipboard();
css::uno::Reference<css::datatransfer::XTransferable> xTrans = xClipboard->getContents();