From 33d05b5ca87d1ddb76fef373a92833d07c00cb15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Wed, 24 Feb 2016 12:19:49 +0000 Subject: [PATCH 5/8] gtk3: handle items without commands e.g. the draw/impress context menus. Handle these like MenuManager::Activate does Change-Id: I02a0e377a2d3a57ac7ac9239aaa75dbb856489d2 (cherry picked from commit b8ee342576b707dbffe877f5c225b640ee65276d) --- vcl/unx/gtk/gtksalmenu.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/vcl/unx/gtk/gtksalmenu.cxx b/vcl/unx/gtk/gtksalmenu.cxx index a9a0932..346e42d 100644 --- a/vcl/unx/gtk/gtksalmenu.cxx +++ b/vcl/unx/gtk/gtksalmenu.cxx @@ -52,7 +52,9 @@ static gchar* GetCommandForItem( GtkSalMenuItem* pSalMenuItem, gchar* aCurrentCo if ( !pMenu ) return nullptr; - OUString aMenuCommand = pMenu->GetItemCommand( nId ); + OUString aMenuCommand = pMenu->GetItemCommand(nId); + if (aMenuCommand.isEmpty()) + aMenuCommand = "slot:" + OUString::number(nId); gchar* aCommandStr = g_strdup( OUStringToOString( aMenuCommand, RTL_TEXTENCODING_UTF8 ).getStr() ); aCommand = g_strdup( aCommandStr ); -- 2.7.1