@@ -300,24 +300,18 @@ void GtkSalMenu::ImplUpdate(bool bRecurse, bool bRemoveDisabledEntries)
300300 OString sNativeCommand = GetCommandForItem (pSalMenuItem);
301301
302302 // Force updating of native menu labels.
303+ NativeSetItemText ( nSection, nItemPos, aText );
304+ NativeSetItemIcon ( nSection, nItemPos, aImage );
305+ NativeSetAccelerator (nSection, nItemPos, nAccelKey, nAccelKey.GetName ());
303306
304307 if (!sNativeCommand .isEmpty () && pSalMenuItem->mpSubMenu == nullptr )
305308 {
306- NativeSetItemText ( nSection, nItemPos, aText, false );
307- NativeSetItemIcon ( nSection, nItemPos, aImage );
308- NativeSetAccelerator (nSection, nItemPos, nAccelKey, nAccelKey.GetName ());
309309 NativeSetItemCommand (nSection, nItemPos, nId, sNativeCommand .getStr (), itemBits, bChecked, false );
310310 NativeCheckItem ( nSection, nItemPos, itemBits, bChecked );
311311 NativeSetEnableItem (sNativeCommand , bEnabled);
312312
313313 pNewCommandList = g_list_append (pNewCommandList, g_strdup (sNativeCommand .getStr ()));
314314 }
315- else
316- {
317- NativeSetItemText ( nSection, nItemPos, aText );
318- NativeSetItemIcon ( nSection, nItemPos, aImage );
319- NativeSetAccelerator (nSection, nItemPos, nAccelKey, nAccelKey.GetName ());
320- }
321315
322316 GtkSalMenu* pSubmenu = pSalMenuItem->mpSubMenu ;
323317
@@ -1175,7 +1169,7 @@ void GtkSalMenu::NativeSetEnableItem(const OString& sCommand, gboolean bEnable)
11751169 g_lo_action_group_set_action_enabled (pActionGroup, sCommand .getStr (), bEnable);
11761170}
11771171
1178- void GtkSalMenu::NativeSetItemText ( unsigned nSection, unsigned nItemPos, const OUString& rText, bool bFireEvent )
1172+ void GtkSalMenu::NativeSetItemText ( unsigned nSection, unsigned nItemPos, const OUString& rText )
11791173{
11801174 SolarMutexGuard aGuard;
11811175 // Escape all underscores so that they don't get interpreted as hotkeys
@@ -1188,7 +1182,7 @@ void GtkSalMenu::NativeSetItemText( unsigned nSection, unsigned nItemPos, const
11881182 gchar* aLabel = g_lo_menu_get_label_from_item_in_section ( G_LO_MENU ( mpMenuModel ), nSection, nItemPos );
11891183
11901184 if ( aLabel == nullptr || g_strcmp0 ( aLabel, aConvertedText.getStr () ) != 0 )
1191- g_lo_menu_set_label_to_item_in_section ( G_LO_MENU ( mpMenuModel ), nSection, nItemPos, aConvertedText.getStr (), bFireEvent );
1185+ g_lo_menu_set_label_to_item_in_section ( G_LO_MENU ( mpMenuModel ), nSection, nItemPos, aConvertedText.getStr () );
11921186
11931187 if ( aLabel )
11941188 g_free ( aLabel );
@@ -1318,9 +1312,7 @@ bool GtkSalMenu::NativeSetItemCommand( unsigned nSection,
13181312 g_free (pLabel);
13191313 }
13201314
1321- // suppress event firing here, we will do so anyway in the g_lo_menu_set_action_and_target_value_to_item_in_section call,
1322- // speeds up constructing menus
1323- g_lo_menu_set_command_to_item_in_section ( pMenu, nSection, nItemPos, aCommand, /* fire_event*/ false );
1315+ g_lo_menu_set_command_to_item_in_section ( pMenu, nSection, nItemPos, aCommand );
13241316
13251317 gchar* aItemCommand = g_strconcat (" win." , aCommand, nullptr );
13261318
0 commit comments