vcl/inc/unx/gtk/gtkinst.hxx | 2 +- vcl/unx/gtk3/gtkinst.cxx | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-)
New commits: commit 127da6671cdbdbfb2e7fa1479d9671e1311a8cd2 Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Sat May 22 20:29:35 2021 +0100 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Sat May 22 22:30:43 2021 +0200 gtk[3|4] there's only two options, 'clipboard' or 'primary' Change-Id: I70d8426a3864551b7632d535864e3639065d0be1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116005 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caol...@redhat.com> diff --git a/vcl/inc/unx/gtk/gtkinst.hxx b/vcl/inc/unx/gtk/gtkinst.hxx index 596f9c3feccb..e0b7bdec5d57 100644 --- a/vcl/inc/unx/gtk/gtkinst.hxx +++ b/vcl/inc/unx/gtk/gtkinst.hxx @@ -263,7 +263,7 @@ public: private: GtkSalTimer *m_pTimer; #if !GTK_CHECK_VERSION(4, 0, 0) - std::unordered_map< GdkAtom, css::uno::Reference<css::uno::XInterface> > m_aClipboards; + css::uno::Reference<css::uno::XInterface> m_aClipboards[2]; #endif bool IsTimerExpired(); bool bNeedsInit; diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx index 207166637df9..572508152846 100644 --- a/vcl/unx/gtk3/gtkinst.cxx +++ b/vcl/unx/gtk3/gtkinst.cxx @@ -1248,13 +1248,13 @@ Reference< XInterface > GtkInstance::CreateClipboard(const Sequence< Any >& argu } #if !GTK_CHECK_VERSION(4, 0, 0) - GdkAtom nSelection = (sel == "CLIPBOARD") ? GDK_SELECTION_CLIPBOARD : GDK_SELECTION_PRIMARY; + unsigned int nSelection = (sel == "CLIPBOARD") ? 0 : 1; - auto it = m_aClipboards.find(nSelection); - if (it != m_aClipboards.end()) - return it->second; + if (m_aClipboards[nSelection].is()) + return m_aClipboards[nSelection]; - Reference<XInterface> xClipboard(static_cast<cppu::OWeakObject *>(new VclGtkClipboard(nSelection))); + GdkAtom nAtom = nSelection == 0 ? GDK_SELECTION_CLIPBOARD : GDK_SELECTION_PRIMARY; + Reference<XInterface> xClipboard(static_cast<cppu::OWeakObject *>(new VclGtkClipboard(nAtom))); m_aClipboards[nSelection] = xClipboard; return xClipboard; #else _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits