[Libreoffice-commits] core.git: 2 commits - sal/inc vcl/inc vcl/unx
Bjoern Michaelsen
bjoern.michaelsen at canonical.com
Fri Apr 19 02:18:50 PDT 2013
sal/inc/rtl/logfile.hxx | 2 +-
vcl/inc/unx/gtk/gtksalmenu.hxx | 3 ++-
vcl/unx/gtk/window/gloactiongroup.cxx | 7 ++++---
vcl/unx/gtk/window/gtksalmenu.cxx | 32 +++++++++++++++++---------------
4 files changed, 24 insertions(+), 20 deletions(-)
New commits:
commit 26d092b3635680248f8b176564409e6c0c24bfbf
Author: Bjoern Michaelsen <bjoern.michaelsen at canonical.com>
Date: Fri Apr 19 11:13:05 2013 +0200
lp#1085169: we overactivate here, as it does not seem to hurt
Change-Id: I4f6e76347c5c9b5c67a09b8c3dcd1b1708e8e703
diff --git a/vcl/inc/unx/gtk/gtksalmenu.hxx b/vcl/inc/unx/gtk/gtksalmenu.hxx
index 35915d8..d161c61 100644
--- a/vcl/inc/unx/gtk/gtksalmenu.hxx
+++ b/vcl/inc/unx/gtk/gtksalmenu.hxx
@@ -52,6 +52,7 @@ private:
GtkSalMenu* GetMenuForItemCommand( gchar* aCommand, gboolean bGetSubmenu );
void ImplUpdate( gboolean bRecurse );
+ void ActivateAllSubmenus(MenuBar* pMenuBar);
public:
GtkSalMenu( sal_Bool bMenuBar );
@@ -97,7 +98,7 @@ public:
void NativeSetAccelerator( unsigned nSection, unsigned nItemPos, const KeyCode& rKeyCode, const OUString& rKeyName );
void DispatchCommand( gint itemId, const gchar* aCommand );
- void Activate( const gchar* aMenuCommand );
+ void Activate();
void Deactivate( const gchar* aMenuCommand );
void Display( sal_Bool bVisible );
bool PrepUpdate();
diff --git a/vcl/unx/gtk/window/gloactiongroup.cxx b/vcl/unx/gtk/window/gloactiongroup.cxx
index 810ac3d..78fecf0 100644
--- a/vcl/unx/gtk/window/gloactiongroup.cxx
+++ b/vcl/unx/gtk/window/gloactiongroup.cxx
@@ -167,20 +167,22 @@ g_lo_action_group_perform_submenu_action (GLOActionGroup *group,
const gchar *action_name,
GVariant *state)
{
- SAL_INFO("vcl.unity", "g_lo_action_group_perform_submenu_action on " << group);
GtkSalFrame* pFrame = group->priv->frame;
+ SAL_INFO("vcl.unity", "g_lo_action_group_perform_submenu_action on " << group << " for frame " << pFrame);
if (pFrame == NULL)
return;
GtkSalMenu* pSalMenu = static_cast<GtkSalMenu*> (pFrame->GetMenu());
+ SAL_INFO("vcl.unity", "g_lo_action_group_perform_submenu_action on " << group << " for menu " << pSalMenu);
if (pSalMenu != NULL) {
gboolean bState = g_variant_get_boolean (state);
+ SAL_INFO("vcl.unity", "g_lo_action_group_perform_submenu_action on " << group << " to " << bState);
if (bState)
- pSalMenu->Activate (action_name);
+ pSalMenu->Activate();
else
pSalMenu->Deactivate (action_name);
}
@@ -191,7 +193,6 @@ g_lo_action_group_change_state (GActionGroup *group,
const gchar *action_name,
GVariant *value)
{
- SAL_INFO("vcl.unity", "g_lo_action_group_perform_submenu_action on " << group);
g_return_if_fail (value != NULL);
g_variant_ref_sink (value);
diff --git a/vcl/unx/gtk/window/gtksalmenu.cxx b/vcl/unx/gtk/window/gtksalmenu.cxx
index c79aee2..c601af1 100644
--- a/vcl/unx/gtk/window/gtksalmenu.cxx
+++ b/vcl/unx/gtk/window/gtksalmenu.cxx
@@ -353,10 +353,6 @@ void GtkSalMenu::ImplUpdate( gboolean bRecurse )
SAL_INFO("vcl.unity", "preparing submenu " << pSubMenuModel << " to menu model " << G_MENU_MODEL(pSubMenuModel) << " and action group " << G_ACTION_GROUP(pActionGroup));
pSubmenu->SetMenuModel( G_MENU_MODEL( pSubMenuModel ) );
pSubmenu->SetActionGroup( G_ACTION_GROUP( pActionGroup ) );
-
- pSubmenu->GetMenu()->Activate();
- pSubmenu->GetMenu()->Deactivate();
-
pSubmenu->ImplUpdate( bRecurse );
}
}
@@ -658,7 +654,6 @@ GtkSalMenu* GtkSalMenu::GetMenuForItemCommand( gchar* aCommand, gboolean bGetSub
{
SolarMutexGuard aGuard;
GtkSalMenu* pMenu = NULL;
-
for ( sal_uInt16 nPos = 0; nPos < maItems.size(); nPos++ )
{
GtkSalMenuItem *pSalItem = maItems[ nPos ];
@@ -695,24 +690,31 @@ void GtkSalMenu::DispatchCommand( gint itemId, const gchar *aCommand )
Menu* pSubMenu = ( pSalSubMenu != NULL ) ? pSalSubMenu->GetMenu() : NULL;
MenuBar* pMenuBar = static_cast< MenuBar* >( mpVCLMenu );
-
pMenuBar->HandleMenuCommandEvent( pSubMenu, itemId );
}
-void GtkSalMenu::Activate( const gchar* aMenuCommand )
+void GtkSalMenu::ActivateAllSubmenus(MenuBar* pMenuBar)
+{
+ pMenuBar->HandleMenuActivateEvent(mpVCLMenu);
+ for ( sal_uInt16 nPos = 0; nPos < maItems.size(); nPos++ )
+ {
+ GtkSalMenuItem *pSalItem = maItems[ nPos ];
+ if ( pSalItem->mpSubMenu != NULL )
+ {
+ pSalItem->mpSubMenu->ActivateAllSubmenus(pMenuBar);
+ pSalItem->mpSubMenu->Update();
+ }
+ }
+}
+
+void GtkSalMenu::Activate()
{
if ( mbMenuBar != TRUE )
return;
-
- GtkSalMenu* pSalSubMenu = GetMenuForItemCommand( (gchar*) aMenuCommand, TRUE );
-
- if ( pSalSubMenu != NULL ) {
- MenuBar* pMenuBar = static_cast< MenuBar* >( mpVCLMenu );
- pMenuBar->HandleMenuActivateEvent( pSalSubMenu->mpVCLMenu );
- pSalSubMenu->Update();
- }
+ ActivateAllSubmenus(static_cast<MenuBar*>(mpVCLMenu));
}
+
void GtkSalMenu::Deactivate( const gchar* aMenuCommand )
{
if ( mbMenuBar == sal_False )
commit bffb03fbc13ec5a1ec6e38773e9f19f7dadf68ff
Author: Bjoern Michaelsen <bjoern.michaelsen at canonical.com>
Date: Fri Apr 19 10:51:08 2013 +0200
better use SAL_LOG_INFO as trigger
Change-Id: I37635f9bd86d194b303705a58d81502d7d586692
diff --git a/sal/inc/rtl/logfile.hxx b/sal/inc/rtl/logfile.hxx
index 12b5fc7..9bc3765 100644
--- a/sal/inc/rtl/logfile.hxx
+++ b/sal/inc/rtl/logfile.hxx
@@ -163,7 +163,7 @@ namespace rtl
rtl_logfile_trace( "\n" )
#else
-#if OSL_DEBUG_LEVEL > 0
+#ifdef SAL_LOG_INFO
#define RTL_LOGFILE_FORWARD_VIA_SAL_LOG(area, message) \
do { \
OStringBuffer full_area; \
More information about the Libreoffice-commits
mailing list