[Libreoffice-commits] core.git: Branch 'libreoffice-6-2' - vcl/inc vcl/qt5

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Fri Dec 14 23:46:01 UTC 2018


 vcl/inc/qt5/Qt5Instance.hxx |    2 +-
 vcl/qt5/Qt5Instance.cxx     |   13 ++++++++-----
 2 files changed, 9 insertions(+), 6 deletions(-)

New commits:
commit d126c07e02963c1262eaa0f9f0aee0f8ed401550
Author:     Katarina Behrens <Katarina.Behrens at cib.de>
AuthorDate: Thu Dec 13 19:15:38 2018 +0100
Commit:     Michael Weghorn <m.weghorn at posteo.de>
CommitDate: Sat Dec 15 00:45:37 2018 +0100

    tdf#122042: It's two clipboards, actually
    
    Change-Id: I0e975bb73211b1d4ddb2e721659f64b361d11322
    (cherry picked from commit f89cf70331c5e493f26e292fd0d7796214efea55)
    Reviewed-on: https://gerrit.libreoffice.org/65167
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <m.weghorn at posteo.de>

diff --git a/vcl/inc/qt5/Qt5Instance.hxx b/vcl/inc/qt5/Qt5Instance.hxx
index d848ff219792..91682bd87950 100644
--- a/vcl/inc/qt5/Qt5Instance.hxx
+++ b/vcl/inc/qt5/Qt5Instance.hxx
@@ -40,7 +40,7 @@ class VCLPLUG_QT5_PUBLIC Qt5Instance : public QObject,
     osl::Condition m_aWaitingYieldCond;
     int m_postUserEventId;
     const bool m_bUseCairo;
-    css::uno::Reference<css::uno::XInterface> m_xClipboard;
+    std::unordered_map<OUString, css::uno::Reference<css::uno::XInterface>> m_aClipboards;
 
 public:
     std::unique_ptr<QApplication> m_pQApplication;
diff --git a/vcl/qt5/Qt5Instance.cxx b/vcl/qt5/Qt5Instance.cxx
index 1acf49d4505a..2e21f2563d90 100644
--- a/vcl/qt5/Qt5Instance.cxx
+++ b/vcl/qt5/Qt5Instance.cxx
@@ -244,14 +244,17 @@ Qt5Instance::CreateClipboard(const css::uno::Sequence<css::uno::Any>& arguments)
                                                   css::uno::Reference<css::uno::XInterface>(), -1);
     }
 
-    if (!m_xClipboard.is())
+    auto it = m_aClipboards.find(sel);
+    if (it != m_aClipboards.end())
     {
-        css::uno::Reference<css::uno::XInterface> xClipboard(
-            static_cast<cppu::OWeakObject*>(new VclQt5Clipboard()));
-        m_xClipboard = xClipboard;
+        return it->second;
     }
 
-    return m_xClipboard;
+    css::uno::Reference<css::uno::XInterface> xClipboard(
+        static_cast<cppu::OWeakObject*>(new VclQt5Clipboard()));
+    m_aClipboards[sel] = xClipboard;
+
+    return xClipboard;
 }
 
 Reference<XInterface> Qt5Instance::CreateDragSource()


More information about the Libreoffice-commits mailing list