summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorAntonio Fernandez <antonio.fernandez@aentos.es>2012-11-13 16:38:09 +0000
committerBjoern Michaelsen <bjoern.michaelsen@canonical.com>2012-11-14 13:53:01 +0100
commit62a803dc46c1ffb5cba7f094868ce339feeecfda (patch)
treefba6d247bf16ebe8c4d0150252349b462b8ed3a1 /vcl
parentc36c5b516168ea63767e8642c0958edcb4704a1d (diff)
Removed AbstractMenu class and cleaned up useless code.
Change-Id: I4094302b83342fd42bccad4966b51624215d71ff
Diffstat (limited to 'vcl')
-rw-r--r--vcl/inc/salmenu.hxx2
-rw-r--r--vcl/inc/unx/gtk/gtksalmenu.hxx2
-rw-r--r--vcl/inc/vcl/menu.hxx94
-rw-r--r--vcl/source/window/menu.cxx13
-rw-r--r--vcl/unx/gtk/window/gtksalmenu.cxx8
5 files changed, 1 insertions, 118 deletions
diff --git a/vcl/inc/salmenu.hxx b/vcl/inc/salmenu.hxx
index 13f058c6047b..5bea40140bba 100644
--- a/vcl/inc/salmenu.hxx
+++ b/vcl/inc/salmenu.hxx
@@ -83,9 +83,7 @@ public:
virtual void RemoveMenuBarButton( sal_uInt16 nId );
// FIXME: Make the other VCL native backends to work with these new methods.
- virtual void SetItemCommand( unsigned, SalMenuItem*, const rtl::OUString& ) {}
virtual void ShowItem( unsigned nPos, sal_Bool bShow ) { EnableItem( nPos, bShow ); }
- virtual void Freeze() {}
// return an empty rectangle if not implemented
// return Rectangle( Point( -1, -1 ), Size( 1, 1 ) ) if menu bar buttons implemented
diff --git a/vcl/inc/unx/gtk/gtksalmenu.hxx b/vcl/inc/unx/gtk/gtksalmenu.hxx
index 3fd65d5bf4e2..53095b8be91f 100644
--- a/vcl/inc/unx/gtk/gtksalmenu.hxx
+++ b/vcl/inc/unx/gtk/gtksalmenu.hxx
@@ -78,8 +78,6 @@ public:
virtual void SetItemImage( unsigned nPos, SalMenuItem* pSalMenuItem, const Image& rImage);
virtual void SetAccelerator( unsigned nPos, SalMenuItem* pSalMenuItem, const KeyCode& rKeyCode, const rtl::OUString& rKeyName );
virtual void GetSystemMenuData( SystemMenuData* pData );
- virtual void SetItemCommand( unsigned nPos, SalMenuItem* pSalMenuItem, const rtl::OUString& aCommandStr );
- virtual void Freeze();
virtual void SetMenu( Menu* pMenu ) { mpVCLMenu = pMenu; }
virtual Menu* GetMenu() { return mpVCLMenu; }
diff --git a/vcl/inc/vcl/menu.hxx b/vcl/inc/vcl/menu.hxx
index 6c12dc67bc0c..9bd5c0b37388 100644
--- a/vcl/inc/vcl/menu.hxx
+++ b/vcl/inc/vcl/menu.hxx
@@ -102,96 +102,6 @@ struct ImplMenuDelData
bool isDeleted() const { return mpMenu == 0; }
};
-// ----------------
-// - AbstractMenu -
-// ----------------
-
-class VCL_DLLPUBLIC AbstractMenu : public Resource
-{
-public:
- virtual ~AbstractMenu() {}
-
- virtual SAL_DLLPRIVATE Window* ImplGetWindow() const = 0;
-
- virtual void InsertItem( sal_uInt16 nItemId, const XubString& rStr,
- MenuItemBits nItemBits = 0,
- sal_uInt16 nPos = MENU_APPEND ) = 0;
- virtual void InsertItem( sal_uInt16 nItemId,
- const XubString& rString, const Image& rImage,
- MenuItemBits nItemBits = 0,
- sal_uInt16 nPos = MENU_APPEND ) = 0;
- virtual void InsertSeparator( sal_uInt16 nPos = MENU_APPEND ) = 0;
- virtual void RemoveItem( sal_uInt16 nPos ) = 0;
- virtual void CopyItem( const Menu& rMenu, sal_uInt16 nPos,
- sal_uInt16 nNewPos = MENU_APPEND ) = 0;
- virtual void Clear() = 0;
-
- virtual void SetMenuFlags( sal_uInt16 nFlags ) = 0;
- virtual sal_uInt16 GetMenuFlags() const = 0;
-
- virtual sal_uInt16 GetItemCount() const = 0;
- virtual sal_uInt16 GetItemId( sal_uInt16 nPos ) const = 0;
- virtual sal_uInt16 GetItemPos( sal_uInt16 nItemId ) const = 0;
- virtual MenuItemType GetItemType( sal_uInt16 nPos ) const = 0;
- virtual sal_uInt16 GetCurItemId() const = 0;
-
- virtual void SetItemBits( sal_uInt16 nItemId, MenuItemBits nBits ) = 0;
- virtual MenuItemBits GetItemBits( sal_uInt16 nItemId ) const = 0;
-
- virtual void SetUserValue( sal_uInt16 nItemId, sal_uLong nValue ) = 0;
- virtual sal_uLong GetUserValue( sal_uInt16 nItemId ) const = 0;
-
- virtual void SetPopupMenu( sal_uInt16 nItemId, PopupMenu* pMenu ) = 0;
- virtual PopupMenu* GetPopupMenu( sal_uInt16 nItemId ) const = 0;
-
- virtual void SetAccelKey( sal_uInt16 nItemId, const KeyCode& rKeyCode ) = 0;
-
- virtual void CheckItem( sal_uInt16 nItemId, sal_Bool bCheck = sal_True ) = 0;
- virtual sal_Bool IsItemChecked( sal_uInt16 nItemId ) const = 0;
-
- virtual void EnableItem( sal_uInt16 nItemId, sal_Bool bEnable = sal_True ) = 0;
- virtual sal_Bool IsItemEnabled( sal_uInt16 nItemId ) const = 0;
-
- virtual void ShowItem( sal_uInt16 nItemId, sal_Bool bVisible = sal_True ) = 0;
- virtual void HideItem( sal_uInt16 nItemId ) = 0;
-
- virtual sal_Bool IsMenuBar() const = 0;
-
- virtual void RemoveDisabledEntries( sal_Bool bCheckPopups = sal_True,
- sal_Bool bRemoveEmptyPopups = sal_False ) = 0;
-
- virtual void SetItemText( sal_uInt16 nItemId, const XubString& rStr ) = 0;
- virtual XubString GetItemText( sal_uInt16 nItemId ) const = 0;
-
- virtual void SetItemImage( sal_uInt16 nItemId, const Image& rImage ) = 0;
- virtual Image GetItemImage( sal_uInt16 nItemId ) const = 0;
-
- virtual void SetItemCommand( sal_uInt16 nItemId, const XubString& rCommand ) = 0;
- virtual const XubString& GetItemCommand( sal_uInt16 nItemId ) const = 0;
-
- virtual void SetTipHelpText( sal_uInt16 nItemId, const XubString& rString ) = 0;
-
- virtual void SetHelpCommand( sal_uInt16 nItemId, const XubString& rString ) = 0;
- virtual const XubString& GetHelpCommand( sal_uInt16 nItemId ) const = 0;
-
- virtual void SetHelpId( sal_uInt16 nItemId, const rtl::OString& rHelpId ) = 0;
- virtual rtl::OString GetHelpId( sal_uInt16 nItemId ) const = 0;
-
- virtual void SetActivateHdl( const Link& rLink ) = 0;
-
- virtual void SetDeactivateHdl( const Link& rLink ) = 0;
-
- virtual void SetHighlightHdl( const Link& rLink ) = 0;
-
- virtual void SetSelectHdl( const Link& rLink ) = 0;
-
- // Returns the system's menu handle if native menus are supported
- // pData must point to a SystemMenuData structure
- virtual sal_Bool GetSystemMenuData( SystemMenuData* pData ) const = 0;
-
- virtual void Freeze(void) = 0;
-};
-
// --------
// - Menu -
// --------
@@ -203,7 +113,7 @@ struct MenuLogo
Color aEndColor;
};
-class VCL_DLLPUBLIC Menu : public AbstractMenu
+class VCL_DLLPUBLIC Menu : public Resource
{
friend class MenuBar;
friend class MenuBarWindow;
@@ -446,8 +356,6 @@ public:
void HighlightItem( sal_uInt16 nItemPos );
void DeHighlight() { HighlightItem( 0xFFFF ); } // MENUITEMPOS_INVALID
-
- void Freeze();
};
// -----------
diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx
index bf220a43f4c4..7fbc21a6f48c 100644
--- a/vcl/source/window/menu.cxx
+++ b/vcl/source/window/menu.cxx
@@ -1953,10 +1953,6 @@ void Menu::SetItemCommand( sal_uInt16 nItemId, const String& rCommand )
if ( pData )
pData->aCommandStr = rCommand;
-
- // update native menu
- if( ImplGetSalMenu() && pData->pSalMenuItem )
- ImplGetSalMenu()->SetItemCommand( nPos, pData->pSalMenuItem, rCommand );
}
const XubString& Menu::GetItemCommand( sal_uInt16 nItemId ) const
@@ -3233,15 +3229,6 @@ void Menu::HighlightItem( sal_uInt16 nItemPos )
}
}
-void Menu::Freeze(void)
-{
- SalMenu *pSalMenu = ImplGetSalMenu();
-
- if ( pSalMenu ) {
- pSalMenu->Freeze();
- }
-}
-
// -----------
// - MenuBar -
diff --git a/vcl/unx/gtk/window/gtksalmenu.cxx b/vcl/unx/gtk/window/gtksalmenu.cxx
index 4b9a358d8211..7c1517e994b1 100644
--- a/vcl/unx/gtk/window/gtksalmenu.cxx
+++ b/vcl/unx/gtk/window/gtksalmenu.cxx
@@ -786,18 +786,10 @@ void GtkSalMenu::SetAccelerator( unsigned, SalMenuItem*, const KeyCode&, const r
{
}
-void GtkSalMenu::SetItemCommand( unsigned, SalMenuItem*, const rtl::OUString& )
-{
-}
-
void GtkSalMenu::GetSystemMenuData( SystemMenuData* )
{
}
-void GtkSalMenu::Freeze()
-{
-}
-
// =======================================================================
/*