[Libreoffice-commits] .: Branch 'feature/unitymenus' - vcl/unx
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Wed Sep 19 12:07:16 PDT 2012
vcl/unx/gtk/window/gtksalmenu.cxx | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
New commits:
commit 22774aff3f1d4b2a09d713555e0180a3eded3155
Author: Antonio Fernandez <antonio.fernandez at 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();
More information about the Libreoffice-commits
mailing list