summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorAntonio Fernandez <antonio.fernandez@aentos.es>2012-09-12 11:39:11 +0100
committerBjoern Michaelsen <bjoern.michaelsen@canonical.com>2012-11-14 13:52:47 +0100
commitcfc3eded6233996ad7103d256b8a36e8d31df3b9 (patch)
treeb9652e82b22ee1d5a283ac5f95d584be9545f5fd /vcl
parent1d4719b3a75babd6a7368bc06dd18b4251ffed93 (diff)
Some code reordering and cleaning.
Change-Id: Ide46f6f68f3ba2632988b490820cb1ca576bab43
Diffstat (limited to 'vcl')
-rw-r--r--vcl/inc/unx/gtk/gtksalmenu.hxx2
-rw-r--r--vcl/unx/gtk/window/gloactiongroup.cxx17
-rw-r--r--vcl/unx/gtk/window/gtksalmenu.cxx66
3 files changed, 35 insertions, 50 deletions
diff --git a/vcl/inc/unx/gtk/gtksalmenu.hxx b/vcl/inc/unx/gtk/gtksalmenu.hxx
index 04b736137fa3..d88c50d181ad 100644
--- a/vcl/inc/unx/gtk/gtksalmenu.hxx
+++ b/vcl/inc/unx/gtk/gtksalmenu.hxx
@@ -61,7 +61,6 @@ public:
GtkSalMenu( sal_Bool bMenuBar );
virtual ~GtkSalMenu();
- virtual void SetVisibleMenuBar( sal_Bool bVisible );
virtual sal_Bool VisibleMenuBar(); // must return TRUE to actually DISPLAY native menu bars
// otherwise only menu messages are processed (eg, OLE on Windows)
@@ -105,7 +104,6 @@ public:
virtual ~GtkSalMenuItem();
sal_uInt16 mnId; // Item ID
- MenuItemBits mnBits; // Item bits
MenuItemType mnType; // Item type
Menu* mpVCLMenu; // VCL Menu into which this MenuItem is inserted
GtkSalMenu* mpParentMenu; // The menu in which this menu item is inserted
diff --git a/vcl/unx/gtk/window/gloactiongroup.cxx b/vcl/unx/gtk/window/gloactiongroup.cxx
index 8f7d4692b851..171341dcd4a7 100644
--- a/vcl/unx/gtk/window/gloactiongroup.cxx
+++ b/vcl/unx/gtk/window/gloactiongroup.cxx
@@ -158,21 +158,17 @@ g_lo_action_group_query_action (GActionGroup *group,
if (enabled)
*enabled = action->enabled;
- if (parameter_type) {
+ if (parameter_type)
*parameter_type = action->parameter_type;
- }
- if (state_type) {
+ if (state_type)
*state_type = action->state_type;
- }
- if (state_hint) {
+ if (state_hint)
*state_hint = (action->state_hint) ? g_variant_ref(action->state_hint) : NULL;
- }
- if (state) {
+ if (state)
*state = (action->state) ? g_variant_ref(action->state) : NULL;
- }
return TRUE;
}
@@ -213,8 +209,6 @@ g_lo_action_group_activate (GActionGroup *group,
GTK_YIELD_GRAB();
GLOActionGroup *lo_group = G_LO_ACTION_GROUP (group);
- GLOAction* action = G_LO_ACTION (g_hash_table_lookup (lo_group->priv->table, action_name));
-
GtkSalFrame *pFrame = lo_group->priv->frame;
if ( pFrame != NULL )
@@ -222,7 +216,10 @@ g_lo_action_group_activate (GActionGroup *group,
GtkSalMenu* pSalMenu = static_cast< GtkSalMenu* >( pFrame->GetMenu() );
if ( pSalMenu != NULL )
+ {
+ GLOAction* action = G_LO_ACTION (g_hash_table_lookup (lo_group->priv->table, action_name));
pSalMenu->DispatchCommand( action->item_id, action_name );
+ }
}
}
diff --git a/vcl/unx/gtk/window/gtksalmenu.cxx b/vcl/unx/gtk/window/gtksalmenu.cxx
index 52e7dd6c9dd1..594d9ac30cbc 100644
--- a/vcl/unx/gtk/window/gtksalmenu.cxx
+++ b/vcl/unx/gtk/window/gtksalmenu.cxx
@@ -146,7 +146,6 @@ static void UpdateNativeMenu( GtkSalMenu* pMenu )
pSubmenu->SetMenuModel( G_MENU_MODEL( pSubMenuModel ) );
pSubmenu->SetActionGroup( pActionGroup );
UpdateNativeMenu( pSubmenu );
-
}
nItemPos++;
@@ -275,7 +274,6 @@ on_registrar_available (GDBusConnection * /*connection*/,
g_free( aDBusMenubarPath );
bDBusIsAvailable = sal_True;
- pSalMenu->SetVisibleMenuBar( sal_True );
pMenuBar->SetDisplayable( sal_False );
}
}
@@ -296,7 +294,6 @@ on_registrar_unavailable (GDBusConnection * /*connection*/,
MenuBar* pMenuBar = static_cast< MenuBar* >( pSalMenu->GetMenu() );
bDBusIsAvailable = sal_False;
- pSalMenu->SetVisibleMenuBar( sal_False );
pMenuBar->SetDisplayable( sal_True );
}
@@ -338,14 +335,8 @@ GtkSalMenu::~GtkSalMenu()
maItems.clear();
}
-void GtkSalMenu::SetVisibleMenuBar( sal_Bool bVisible )
-{
-// mbVisible = bVisible;
-}
-
sal_Bool GtkSalMenu::VisibleMenuBar()
{
-// return mbVisible;
return bDBusIsAvailable;
}
@@ -428,10 +419,6 @@ const GtkSalFrame* GtkSalMenu::GetFrame() const
return pMenu ? pMenu->mpFrame : NULL;
}
-void GtkSalMenu::CheckItem( unsigned nPos, sal_Bool bCheck )
-{
-}
-
void GtkSalMenu::NativeCheckItem( unsigned nSection, unsigned nItemPos, MenuItemBits bits, gboolean bCheck )
{
if ( mpActionGroup == NULL )
@@ -463,10 +450,6 @@ void GtkSalMenu::NativeCheckItem( unsigned nSection, unsigned nItemPos, MenuItem
g_free( aCommand );
}
-void GtkSalMenu::EnableItem( unsigned nPos, sal_Bool bEnable )
-{
-}
-
void GtkSalMenu::NativeSetEnableItem( gchar* aCommand, gboolean bEnable )
{
GLOActionGroup* pActionGroup = G_LO_ACTION_GROUP( mpActionGroup );
@@ -475,10 +458,6 @@ void GtkSalMenu::NativeSetEnableItem( gchar* aCommand, gboolean bEnable )
g_lo_action_group_set_action_enabled( pActionGroup, aCommand, bEnable );
}
-void GtkSalMenu::SetItemText( unsigned nPos, SalMenuItem* pSalMenuItem, const rtl::OUString& rText )
-{
-}
-
void GtkSalMenu::NativeSetItemText( unsigned nSection, unsigned nItemPos, const rtl::OUString& rText )
{
// Replace the "~" character with "_".
@@ -495,14 +474,6 @@ void GtkSalMenu::NativeSetItemText( unsigned nSection, unsigned nItemPos, const
g_free( aLabel );
}
-void GtkSalMenu::SetItemImage( unsigned nPos, SalMenuItem* pSalMenuItem, const Image& rImage)
-{
-}
-
-void GtkSalMenu::SetAccelerator( unsigned nPos, SalMenuItem* pSalMenuItem, const KeyCode& rKeyCode, const rtl::OUString& rKeyName )
-{
-}
-
void GtkSalMenu::NativeSetAccelerator( unsigned nSection, unsigned nItemPos, const KeyCode& rKeyCode, const rtl::OUString& rKeyName )
{
if ( rKeyName.isEmpty() )
@@ -519,10 +490,6 @@ void GtkSalMenu::NativeSetAccelerator( unsigned nSection, unsigned nItemPos, con
g_free( aCurrentAccel );
}
-void GtkSalMenu::SetItemCommand( unsigned nPos, SalMenuItem* pSalMenuItem, const rtl::OUString& aCommandStr )
-{
-}
-
void GtkSalMenu::NativeSetItemCommand( unsigned nSection, unsigned nItemPos, GtkSalMenuItem* pItem, const gchar* aCommand )
{
GLOActionGroup* pActionGroup = G_LO_ACTION_GROUP( mpActionGroup );
@@ -580,10 +547,6 @@ void GtkSalMenu::NativeSetItemCommand( unsigned nSection, unsigned nItemPos, Gtk
g_free( aCurrentCommand );
}
-void GtkSalMenu::GetSystemMenuData( SystemMenuData* pData )
-{
-}
-
GtkSalMenu* GtkSalMenu::GetMenuForItemCommand( gchar* aCommand )
{
GtkSalMenu* pMenu = NULL;
@@ -628,6 +591,34 @@ void GtkSalMenu::DispatchCommand( gint itemId, const gchar *aCommand )
pMenuBar->HandleMenuCommandEvent( pSubMenu, itemId );
}
+void GtkSalMenu::CheckItem( unsigned nPos, sal_Bool bCheck )
+{
+}
+
+void GtkSalMenu::EnableItem( unsigned nPos, sal_Bool bEnable )
+{
+}
+
+void GtkSalMenu::SetItemText( unsigned nPos, SalMenuItem* pSalMenuItem, const rtl::OUString& rText )
+{
+}
+
+void GtkSalMenu::SetItemImage( unsigned nPos, SalMenuItem* pSalMenuItem, const Image& rImage)
+{
+}
+
+void GtkSalMenu::SetAccelerator( unsigned nPos, SalMenuItem* pSalMenuItem, const KeyCode& rKeyCode, const rtl::OUString& rKeyName )
+{
+}
+
+void GtkSalMenu::SetItemCommand( unsigned nPos, SalMenuItem* pSalMenuItem, const rtl::OUString& aCommandStr )
+{
+}
+
+void GtkSalMenu::GetSystemMenuData( SystemMenuData* pData )
+{
+}
+
void GtkSalMenu::Freeze()
{
}
@@ -640,7 +631,6 @@ void GtkSalMenu::Freeze()
GtkSalMenuItem::GtkSalMenuItem( const SalItemParams* pItemData ) :
mnId( pItemData->nId ),
- mnBits( pItemData->nBits ),
mnType( pItemData->eType ),
mpVCLMenu( pItemData->pMenu ),
mpParentMenu( NULL ),