vcl/unx/gtk/window/gtksalmenu.cxx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)
New commits: commit 22774aff3f1d4b2a09d713555e0180a3eded3155 Author: Antonio Fernandez <antonio.fernan...@aentos.es> Date: Wed Sep 19 20:05:56 2012 +0100 Fixed a crash updating the menu after opening an application from main screen. Change-Id: If7b603dca5aa33e50a63e04fda3bce594840cc57 diff --git a/vcl/unx/gtk/window/gtksalmenu.cxx b/vcl/unx/gtk/window/gtksalmenu.cxx index fe3b4cd..60942a5 100644 --- a/vcl/unx/gtk/window/gtksalmenu.cxx +++ b/vcl/unx/gtk/window/gtksalmenu.cxx @@ -130,6 +130,8 @@ static void UpdateNativeMenu2( GtkSalMenu *pMenu ) if ( pSubmenu && pSubmenu->GetMenu() ) { + pMenu->NativeSetItemCommand( nSection, nItemPos, nId, aNativeCommand, itemBits, FALSE, TRUE ); + GLOMenu* pSubMenuModel = g_lo_menu_get_submenu_from_item_in_section( pLOMenu, nSection, nItemPos ); if ( pSubMenuModel == NULL ) @@ -138,7 +140,8 @@ static void UpdateNativeMenu2( GtkSalMenu *pMenu ) g_lo_menu_set_submenu_to_item_in_section( pLOMenu, nSection, nItemPos, G_MENU_MODEL( pSubMenuModel ) ); } - pMenu->NativeSetItemCommand( nSection, nItemPos, nId, aNativeCommand, itemBits, FALSE, TRUE ); + g_object_unref( pSubMenuModel ); + pSubmenu->SetMenuModel( G_MENU_MODEL( pSubMenuModel ) ); pSubmenu->SetActionGroup( pActionGroup ); } @@ -230,6 +233,8 @@ static void UpdateNativeMenu( GtkSalMenu* pMenu ) if ( pSubmenu && pSubmenu->GetMenu() ) { + pMenu->NativeSetItemCommand( nSection, nItemPos, nId, aNativeCommand, itemBits, FALSE, TRUE ); + GLOMenu* pSubMenuModel = g_lo_menu_get_submenu_from_item_in_section( pLOMenu, nSection, nItemPos ); if ( pSubMenuModel == NULL ) @@ -238,7 +243,7 @@ static void UpdateNativeMenu( GtkSalMenu* pMenu ) g_lo_menu_set_submenu_to_item_in_section( pLOMenu, nSection, nItemPos, G_MENU_MODEL( pSubMenuModel ) ); } - pMenu->NativeSetItemCommand( nSection, nItemPos, nId, aNativeCommand, itemBits, FALSE, TRUE ); + g_object_unref( pSubMenuModel ); pSubmenu->GetMenu()->Activate(); pSubmenu->GetMenu()->Deactivate(); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits