[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/source vcl/unx

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Thu May 6 13:50:35 UTC 2021


 include/vcl/weld.hxx          |    5 +++++
 vcl/inc/salvtables.hxx        |    2 ++
 vcl/source/app/salvtables.cxx |    6 ++++++
 vcl/unx/gtk3/gtk3gtkinst.cxx  |    7 +++++++
 4 files changed, 20 insertions(+)

New commits:
commit 1ff996e5e720d77ce32b8c44d4c29569ddbc113a
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Thu May 6 10:03:21 2021 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Thu May 6 15:49:45 2021 +0200

    add get_clipboard to widget
    
    Change-Id: I9a623e558bc18286af773e0aa3120185a30baa52
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115172
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx
index 9821005fb9e6..03ec14dc1a8a 100644
--- a/include/vcl/weld.hxx
+++ b/include/vcl/weld.hxx
@@ -34,6 +34,10 @@ namespace com::sun::star::awt
 {
 class XWindow;
 }
+namespace com::sun::star::datatransfer::clipboard
+{
+class XClipboard;
+}
 namespace com::sun::star::datatransfer::dnd
 {
 class XDropTarget;
@@ -333,6 +337,7 @@ public:
     virtual void set_background(const Color& rBackColor) = 0;
 
     virtual css::uno::Reference<css::datatransfer::dnd::XDropTarget> get_drop_target() = 0;
+    virtual css::uno::Reference<css::datatransfer::clipboard::XClipboard> get_clipboard() const = 0;
 
     virtual void connect_get_property_tree(const Link<tools::JsonWriter&, void>& rLink) = 0;
     virtual void get_property_tree(tools::JsonWriter& rJsonWriter) = 0;
diff --git a/vcl/inc/salvtables.hxx b/vcl/inc/salvtables.hxx
index c274b4bd234c..dc48a8d66695 100644
--- a/vcl/inc/salvtables.hxx
+++ b/vcl/inc/salvtables.hxx
@@ -367,6 +367,8 @@ public:
     virtual VclPtr<VirtualDevice> create_virtual_device() const override;
 
     virtual css::uno::Reference<css::datatransfer::dnd::XDropTarget> get_drop_target() override;
+    virtual css::uno::Reference<css::datatransfer::clipboard::XClipboard>
+    get_clipboard() const override;
 
     virtual void connect_get_property_tree(const Link<tools::JsonWriter&, void>& rLink) override;
 
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index a74e14120058..4a19030397c7 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -553,6 +553,12 @@ css::uno::Reference<css::datatransfer::dnd::XDropTarget> SalInstanceWidget::get_
     return m_xWidget->GetDropTarget();
 }
 
+css::uno::Reference<css::datatransfer::clipboard::XClipboard>
+SalInstanceWidget::get_clipboard() const
+{
+    return m_xWidget->GetClipboard();
+}
+
 void SalInstanceWidget::connect_get_property_tree(const Link<tools::JsonWriter&, void>& rLink)
 {
     m_xWidget->SetDumpAsPropertyTreeHdl(rLink);
diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx
index afb3aeba724e..b4ad243c0422 100644
--- a/vcl/unx/gtk3/gtk3gtkinst.cxx
+++ b/vcl/unx/gtk3/gtk3gtkinst.cxx
@@ -3064,6 +3064,13 @@ public:
         return m_xDropTarget;
     }
 
+    virtual css::uno::Reference<css::datatransfer::clipboard::XClipboard> get_clipboard() const override
+    {
+        // the gen backend can have per-frame clipboards which is (presumably) useful for LibreOffice Online
+        // but normal usage is the shared system clipboard
+        return GetSystemClipboard();
+    }
+
     virtual void connect_get_property_tree(const Link<tools::JsonWriter&, void>& /*rLink*/) override
     {
         //not implemented for the gtk variant


More information about the Libreoffice-commits mailing list