diff options
-rw-r--r-- | vcl/inc/unx/gtk/gtkinst.hxx | 2 | ||||
-rw-r--r-- | vcl/unx/gtk3/gtkinst.cxx | 10 |
2 files changed, 6 insertions, 6 deletions
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 |