vcl/inc/unx/gtk/gtkinst.hxx | 3 ++- vcl/unx/gtk3/gtkinst.cxx | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-)
New commits: commit 9bbebc4a22b85e12a6e229c004176a56bd6377b3 Author: Michael Weghorn <[email protected]> AuthorDate: Fri Feb 27 11:19:26 2026 +0100 Commit: Michael Weghorn <[email protected]> CommitDate: Sat Feb 28 09:11:38 2026 +0100 vcl: Switch GtkInstance::m_aClipboards to unordered_map This is in preparation of converting the SelectionType enum into an enum class in an upcoming commit. Change-Id: Id986fab9c3f1b682060f59b38a5a2d9a7a349fb9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200612 Tested-by: Jenkins Reviewed-by: Michael Weghorn <[email protected]> diff --git a/vcl/inc/unx/gtk/gtkinst.hxx b/vcl/inc/unx/gtk/gtkinst.hxx index f5c6302c95e1..09bb6066258c 100644 --- a/vcl/inc/unx/gtk/gtkinst.hxx +++ b/vcl/inc/unx/gtk/gtkinst.hxx @@ -297,7 +297,8 @@ public: private: GtkSalTimer *m_pTimer; - css::uno::Reference<css::datatransfer::clipboard::XClipboard> m_aClipboards[2]; + std::unordered_map<SelectionType, css::uno::Reference<css::datatransfer::clipboard::XClipboard>> + m_aClipboards; bool IsTimerExpired(); bool bNeedsInit; cairo_font_options_t* m_pLastCairoFontOptions; diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx index 55fcf69f5a22..3533dfb9106b 100644 --- a/vcl/unx/gtk3/gtkinst.cxx +++ b/vcl/unx/gtk3/gtkinst.cxx @@ -1629,8 +1629,9 @@ GtkInstance::CreateClipboard(const Sequence<Any>& arguments) SelectionType eSelection = (sel == "CLIPBOARD") ? SELECTION_CLIPBOARD : SELECTION_PRIMARY; - if (m_aClipboards[eSelection].is()) - return m_aClipboards[eSelection]; + auto aIt = m_aClipboards.find(eSelection); + if (aIt != m_aClipboards.end()) + return aIt->second; Reference<css::datatransfer::clipboard::XClipboard> xClipboard(new VclGtkClipboard(eSelection)); m_aClipboards[eSelection] = xClipboard;
