diff options
-rw-r--r-- | vcl/inc/unx/gtk/gtkdata.hxx | 3 | ||||
-rw-r--r-- | vcl/unx/gtk3/gtkinst.cxx | 4 | ||||
-rw-r--r-- | vcl/unx/gtk3/gtksalmenu.cxx | 11 |
3 files changed, 9 insertions, 9 deletions
diff --git a/vcl/inc/unx/gtk/gtkdata.hxx b/vcl/inc/unx/gtk/gtkdata.hxx index 185a000e0398..5299d15a2088 100644 --- a/vcl/inc/unx/gtk/gtkdata.hxx +++ b/vcl/inc/unx/gtk/gtkdata.hxx @@ -192,6 +192,9 @@ inline GdkGLContext* surface_create_gl_context(GdkSurface* pSurface) #endif } +void set_buildable_id(GtkBuildable* pWidget, const OString& rId); +OString get_buildable_id(GtkBuildable* pWidget); + #if !GTK_CHECK_VERSION(4, 0, 0) typedef GtkClipboard GdkClipboard; #endif diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx index ec87c2785741..c648bfee534d 100644 --- a/vcl/unx/gtk3/gtkinst.cxx +++ b/vcl/unx/gtk3/gtkinst.cxx @@ -2495,6 +2495,8 @@ void set_cursor(GtkWidget* pWidget, const char *pName) #endif } +} + OString get_buildable_id(GtkBuildable* pWidget) { #if GTK_CHECK_VERSION(4, 0, 0) @@ -2515,6 +2517,8 @@ void set_buildable_id(GtkBuildable* pWidget, const OString& rId) #endif } +namespace { + class GtkInstanceWidget : public virtual weld::Widget { protected: diff --git a/vcl/unx/gtk3/gtksalmenu.cxx b/vcl/unx/gtk3/gtksalmenu.cxx index 1ef9dfc88137..a202f75760e3 100644 --- a/vcl/unx/gtk3/gtksalmenu.cxx +++ b/vcl/unx/gtk3/gtksalmenu.cxx @@ -787,12 +787,7 @@ namespace static void MenuButtonClicked(GtkWidget* pWidget, gpointer pMenu) { -#if !GTK_CHECK_VERSION(4, 0, 0) - const gchar* pStr = gtk_buildable_get_name(GTK_BUILDABLE(pWidget)); -#else - const char* pStr = gtk_buildable_get_buildable_id(GTK_BUILDABLE(pWidget)); -#endif - OString aId(pStr, pStr ? strlen(pStr) : 0); + OString aId(get_buildable_id(GTK_BUILDABLE(pWidget))); static_cast<MenuBar*>(pMenu)->HandleMenuButtonEvent(aId.toUInt32()); } @@ -829,9 +824,7 @@ bool GtkSalMenu::AddMenuBarButton(const SalMenuButtonItem& rNewItem) maExtraButtons.emplace_back(rNewItem.mnId, pButton); -#if !GTK_CHECK_VERSION(4, 0, 0) - gtk_buildable_set_name(GTK_BUILDABLE(pButton), OString::number(rNewItem.mnId).getStr()); -#endif + set_buildable_id(GTK_BUILDABLE(pButton), OString::number(rNewItem.mnId).getStr()); gtk_widget_set_tooltip_text(pButton, rNewItem.maToolTipText.toUtf8().getStr()); |