cui/source/dialogs/screenshotannotationdlg.cxx |    7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

New commits:
commit e065964d8ef22ea2abce490e333aa75eaf3463c0
Author:     Michael Weghorn <[email protected]>
AuthorDate: Fri Feb 27 18:52:47 2026 +0100
Commit:     Michael Weghorn <[email protected]>
CommitDate: Sat Feb 28 09:37:39 2026 +0100

    cui: Don't use SystemClipboard service ctor in ScreenshotAnnotationDlg_Impl
    
    Instead, simply use weld::Widget::get_clipboard to
    get the clipboard instance.
    
    Change-Id: Ic8c8f47838995813ec548e5751bcf02f9b09bfe9
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200651
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <[email protected]>

diff --git a/cui/source/dialogs/screenshotannotationdlg.cxx 
b/cui/source/dialogs/screenshotannotationdlg.cxx
index 3842ef0d108b..2c33d76a2294 100644
--- a/cui/source/dialogs/screenshotannotationdlg.cxx
+++ b/cui/source/dialogs/screenshotannotationdlg.cxx
@@ -26,7 +26,6 @@
 #include <com/sun/star/ui/dialogs/TemplateDescription.hpp>
 #include <com/sun/star/ui/dialogs/ExecutableDialogResults.hpp>
 #include <com/sun/star/ui/dialogs/XFilePicker3.hpp>
-#include <com/sun/star/datatransfer/clipboard/SystemClipboard.hpp>
 #include <com/sun/star/datatransfer/clipboard/XClipboard.hpp>
 #include <com/sun/star/datatransfer/DataFlavor.hpp>
 #include <com/sun/star/uno/Any.hxx>
@@ -332,11 +331,9 @@ IMPL_LINK_NOARG(ScreenshotAnnotationDlg_Impl, 
copyButtonHandler, weld::Button&,
 
     // Create a BitmapTransferable
     rtl::Reference<TransferableHelper> xClipCntnr = new 
BitmapTransferable(aTargetBitmap);
-    // Get the system clipboard
-    css::uno::Reference<css::datatransfer::clipboard::XClipboard> xClipboard =
-        css::datatransfer::clipboard::SystemClipboard::create(
-            comphelper::getProcessComponentContext());
 
+    css::uno::Reference<css::datatransfer::clipboard::XClipboard> xClipboard =
+        mxCopy->get_clipboard();
     if (xClipboard.is())
     {
         // Copy the BitmapTransferable to the clipboard

Reply via email to