diff options
author | Noel Grandin <noel@peralex.com> | 2014-10-21 08:39:46 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2014-10-23 12:55:35 +0200 |
commit | 035fe8a6aa6489740a7c9f4e1768452319a686d3 (patch) | |
tree | 0d0341d222b24cfa59d4b79c9420a9e116cc6a78 | |
parent | WaE: unused parameters (diff) | |
download | core-035fe8a6aa6489740a7c9f4e1768452319a686d3.tar.gz core-035fe8a6aa6489740a7c9f4e1768452319a686d3.zip |
fdo#84938: replace MENUITEM constants with enum
Change-Id: I7b0085af3b13bd6e1a50bf1e0e986d1524b52d7b
25 files changed, 91 insertions, 90 deletions
diff --git a/accessibility/source/standard/accessiblemenubasecomponent.cxx b/accessibility/source/standard/accessiblemenubasecomponent.cxx index 8e29d651b392..9ab7b0c6849d 100644 --- a/accessibility/source/standard/accessiblemenubasecomponent.cxx +++ b/accessibility/source/standard/accessiblemenubasecomponent.cxx @@ -345,7 +345,7 @@ Reference< XAccessible > OAccessibleMenuBaseComponent::GetChild( sal_Int32 i ) // create a new child OAccessibleMenuBaseComponent* pChild; - if ( m_pMenu->GetItemType( (sal_uInt16)i ) == MENUITEM_SEPARATOR ) + if ( m_pMenu->GetItemType( (sal_uInt16)i ) == MenuItemType::SEPARATOR ) { pChild = new VCLXAccessibleMenuSeparator( m_pMenu, (sal_uInt16)i ); } diff --git a/dbaccess/source/ui/control/dbtreelistbox.cxx b/dbaccess/source/ui/control/dbtreelistbox.cxx index 213933fc4408..a91b22cee9b5 100644 --- a/dbaccess/source/ui/control/dbtreelistbox.cxx +++ b/dbaccess/source/ui/control/dbtreelistbox.cxx @@ -430,7 +430,7 @@ namespace sal_uInt16 nCount = _pPopup->GetItemCount(); for (sal_uInt16 i=0; i < nCount; ++i) { - if ( _pPopup->GetItemType(i) != MENUITEM_SEPARATOR ) + if ( _pPopup->GetItemType(i) != MenuItemType::SEPARATOR ) { sal_uInt16 nId = _pPopup->GetItemId(i); PopupMenu* pSubPopUp = _pPopup->GetPopupMenu(nId); @@ -462,7 +462,7 @@ namespace for ( sal_uInt16 pos = 0; pos < nCount; ++pos ) { // do not adjust separators - if ( _rMenu.GetItemType( pos ) == MENUITEM_SEPARATOR ) + if ( _rMenu.GetItemType( pos ) == MenuItemType::SEPARATOR ) continue; sal_uInt16 nId = _rMenu.GetItemId(pos); @@ -498,7 +498,7 @@ namespace for ( sal_uInt16 pos = 0; pos < nCount; ++pos ) { // do not adjust separators - if ( _rMenu.GetItemType( pos ) == MENUITEM_SEPARATOR ) + if ( _rMenu.GetItemType( pos ) == MenuItemType::SEPARATOR ) continue; sal_uInt16 nId = _rMenu.GetItemId(pos); diff --git a/dbaccess/source/ui/control/toolboxcontroller.cxx b/dbaccess/source/ui/control/toolboxcontroller.cxx index 11a514628957..5bbd3b0abe5c 100644 --- a/dbaccess/source/ui/control/toolboxcontroller.cxx +++ b/dbaccess/source/ui/control/toolboxcontroller.cxx @@ -59,7 +59,7 @@ namespace dbaui { void lcl_copy(Menu* _pMenu,sal_uInt16 _nMenuId,sal_uInt16 _nMenuPos,ToolBox* _pToolBox,sal_uInt16 _nToolId,const OUString& _sCommand) { - if ( _pMenu->GetItemType(_nMenuPos) != MENUITEM_STRING ) + if ( _pMenu->GetItemType(_nMenuPos) != MenuItemType::STRING ) _pToolBox->SetItemImage(_nToolId, _pMenu->GetItemImage(_nMenuId)); _pToolBox->SetItemCommand( _nToolId, _sCommand); _pToolBox->SetHelpId(_nToolId, _pMenu->GetHelpId(_nMenuId)); @@ -194,7 +194,7 @@ namespace dbaui sal_uInt16 nCount = pMenu->GetItemCount(); for (sal_uInt16 nPos = 0; nPos < nCount; ++nPos) { - if ( pMenu->GetItemType( nPos ) == MENUITEM_SEPARATOR ) + if ( pMenu->GetItemType( nPos ) == MenuItemType::SEPARATOR ) continue; sal_uInt16 nItemId = pMenu->GetItemId(nPos); diff --git a/framework/source/classes/menumanager.cxx b/framework/source/classes/menumanager.cxx index e246e8f6a83c..9943a4d55e4c 100644 --- a/framework/source/classes/menumanager.cxx +++ b/framework/source/classes/menumanager.cxx @@ -152,7 +152,7 @@ MenuManager::MenuManager( if ( pSubMenu && ( pSubMenu->GetItemCount() > 0 )) { sal_uInt16 nCount = 0; - if ( pPopupMenu->GetItemType( nCount-1 ) != MENUITEM_SEPARATOR ) + if ( pPopupMenu->GetItemType( nCount-1 ) != MenuItemType::SEPARATOR ) pPopupMenu->InsertSeparator(); // Use resource to load popup menu title @@ -209,7 +209,7 @@ MenuManager::MenuManager( pMenu->SetItemImage( nItemId, aImage ); } } - else if ( pMenu->GetItemType( i ) != MENUITEM_SEPARATOR ) + else if ( pMenu->GetItemType( i ) != MenuItemType::SEPARATOR ) { if ( bShowMenuImages ) { @@ -520,7 +520,7 @@ void MenuManager::UpdateSpecialFileMenu( Menu* pMenu ) ++nRemoveItemCount; } - if ( pMenu->GetItemType( pMenu->GetItemCount()-1 ) == MENUITEM_SEPARATOR ) + if ( pMenu->GetItemType( pMenu->GetItemCount()-1 ) == MenuItemType::SEPARATOR ) pMenu->RemoveItem( pMenu->GetItemCount()-1 ); // remove all old picklist entries from menu handler @@ -647,7 +647,7 @@ void MenuManager::UpdateSpecialWindowMenu( Menu* pMenu,const Reference< XCompone for ( sal_uInt16 n = nPos; n < pMenu->GetItemCount(); ) pMenu->RemoveItem( n ); - if ( pMenu->GetItemType( pMenu->GetItemCount()-1 ) == MENUITEM_SEPARATOR ) + if ( pMenu->GetItemType( pMenu->GetItemCount()-1 ) == MenuItemType::SEPARATOR ) pMenu->RemoveItem( pMenu->GetItemCount()-1 ); } @@ -827,7 +827,7 @@ IMPL_LINK( MenuManager, Select, Menu *, pMenu ) sal_uInt16 nCurItemId = pMenu->GetCurItemId(); if ( pMenu == m_pVCLMenu && - pMenu->GetItemType( nCurItemId ) != MENUITEM_SEPARATOR ) + pMenu->GetItemType( nCurItemId ) != MenuItemType::SEPARATOR ) { if ( nCurItemId >= START_ITEMID_WINDOWLIST && nCurItemId <= END_ITEMID_WINDOWLIST ) @@ -928,7 +928,7 @@ void MenuManager::FillMenuImages(Reference< XFrame >& _xFrame, Menu* _pMenu,bool for ( sal_uInt16 nPos = 0; nPos < _pMenu->GetItemCount(); nPos++ ) { sal_uInt16 nId = _pMenu->GetItemId( nPos ); - if ( _pMenu->GetItemType( nPos ) != MENUITEM_SEPARATOR ) + if ( _pMenu->GetItemType( nPos ) != MenuItemType::SEPARATOR ) { bool bTmpShowMenuImages( bShowMenuImages ); // overwrite the show icons on menu option? diff --git a/framework/source/fwe/classes/addonmenu.cxx b/framework/source/fwe/classes/addonmenu.cxx index acdbec33eef6..86a3ebeef1e3 100644 --- a/framework/source/fwe/classes/addonmenu.cxx +++ b/framework/source/fwe/classes/addonmenu.cxx @@ -56,7 +56,7 @@ AddonMenu::~AddonMenu() { for ( sal_uInt16 i = 0; i < GetItemCount(); i++ ) { - if ( GetItemType( i ) != MENUITEM_SEPARATOR ) + if ( GetItemType( i ) != MenuItemType::SEPARATOR ) { // delete user attributes created with new! sal_uInt16 nId = GetItemId( i ); @@ -193,7 +193,7 @@ void AddonMenuManager::MergeAddonHelpMenu( const Reference< XFrame >& rFrame, const Sequence< Sequence< PropertyValue > >& rAddonHelpMenuEntries = aOptions.GetAddonsHelpMenu(); - if ( nInsPos < nItemCount && pHelpMenu->GetItemType( nInsPos ) != MENUITEM_SEPARATOR ) + if ( nInsPos < nItemCount && pHelpMenu->GetItemType( nInsPos ) != MenuItemType::SEPARATOR ) nInsSepAfterPos = nInsPos; ::rtl::OUString aModuleIdentifier = GetModuleIdentifier(rContext, rFrame); @@ -204,7 +204,7 @@ void AddonMenuManager::MergeAddonHelpMenu( const Reference< XFrame >& rFrame, if ( nInsSepAfterPos < MENU_APPEND ) { nInsSepAfterPos += ( pHelpMenu->GetItemCount() - nItemCount ); - if ( pHelpMenu->GetItemType( nInsSepAfterPos ) != MENUITEM_SEPARATOR ) + if ( pHelpMenu->GetItemType( nInsSepAfterPos ) != MenuItemType::SEPARATOR ) pHelpMenu->InsertSeparator(OString(), nInsSepAfterPos); } pHelpMenu->InsertSeparator(OString(), nItemCount); diff --git a/framework/source/fwe/helper/actiontriggerhelper.cxx b/framework/source/fwe/helper/actiontriggerhelper.cxx index 6f3e2021b6f3..4e2796a7472f 100644 --- a/framework/source/fwe/helper/actiontriggerhelper.cxx +++ b/framework/source/fwe/helper/actiontriggerhelper.cxx @@ -323,7 +323,7 @@ void FillActionTriggerContainerWithMenu( const Menu* pMenu, Reference< XIndexCon Any a; Reference< XPropertySet > xPropSet; - if ( nType == MENUITEM_SEPARATOR ) + if ( nType == MenuItemType::SEPARATOR ) { xPropSet = CreateActionTriggerSeparator( rActionTriggerContainer ); diff --git a/framework/source/uielement/menubarmanager.cxx b/framework/source/uielement/menubarmanager.cxx index 057bc0ccc20b..705a508dd052 100644 --- a/framework/source/uielement/menubarmanager.cxx +++ b/framework/source/uielement/menubarmanager.cxx @@ -813,7 +813,7 @@ IMPL_LINK( MenuBarManager, Activate, Menu *, pMenu ) for ( sal_uInt16 nPos = 0; nPos < pMenu->GetItemCount(); nPos++ ) { sal_uInt16 nItemId = pMenu->GetItemId( nPos ); - if (( pMenu->GetItemType( nPos ) != MENUITEM_SEPARATOR ) && + if (( pMenu->GetItemType( nPos ) != MenuItemType::SEPARATOR ) && ( pMenu->GetItemText( nItemId ).isEmpty() )) { OUString aCommand = pMenu->GetItemCommand( nItemId ); @@ -1008,7 +1008,7 @@ IMPL_LINK( MenuBarManager, Select, Menu *, pMenu ) sal_uInt16 nCurItemId = pMenu->GetCurItemId(); sal_uInt16 nCurPos = pMenu->GetItemPos( nCurItemId ); if ( pMenu == m_pVCLMenu && - pMenu->GetItemType( nCurPos ) != MENUITEM_SEPARATOR ) + pMenu->GetItemType( nCurPos ) != MenuItemType::SEPARATOR ) { if ( nCurItemId >= START_ITEMID_WINDOWLIST && nCurItemId <= END_ITEMID_WINDOWLIST ) @@ -1294,7 +1294,7 @@ void MenuBarManager::FillMenuManager( Menu* pMenu, const Reference< XFrame >& rF if ( pSubMenu && ( pSubMenu->GetItemCount() > 0 )) { sal_uInt16 nCount = 0; - if ( pPopup->GetItemType( nCount-1 ) != MENUITEM_SEPARATOR ) + if ( pPopup->GetItemType( nCount-1 ) != MenuItemType::SEPARATOR ) pPopup->InsertSeparator(); // Use resource to load popup menu title @@ -1336,7 +1336,7 @@ void MenuBarManager::FillMenuManager( Menu* pMenu, const Reference< XFrame >& rF } } } - else if ( pMenu->GetItemType( i ) != MENUITEM_SEPARATOR ) + else if ( pMenu->GetItemType( i ) != MenuItemType::SEPARATOR ) { if ( bItemShowMenuImages ) { @@ -1963,7 +1963,7 @@ void MenuBarManager::Init(const Reference< XFrame >& rFrame,AddonMenu* pAddonMen } else { - if ( pAddonMenu->GetItemType( i ) != MENUITEM_SEPARATOR ) + if ( pAddonMenu->GetItemType( i ) != MenuItemType::SEPARATOR ) { MenuConfiguration::Attributes* pAddonAttributes = reinterpret_cast<MenuConfiguration::Attributes *>(pAddonMenu->GetUserValue( nItemId )); MenuItemHandler* pMenuItemHandler = new MenuItemHandler( nItemId, xStatusListener, xDispatch ); diff --git a/framework/source/uielement/newmenucontroller.cxx b/framework/source/uielement/newmenucontroller.cxx index a827b8a535cc..08a787dba40c 100644 --- a/framework/source/uielement/newmenucontroller.cxx +++ b/framework/source/uielement/newmenucontroller.cxx @@ -127,7 +127,7 @@ void NewMenuController::determineAndSetNewDocAccel( PopupMenu* pPopupMenu, const for ( sal_uInt32 i = 0; i < sal_uInt32( nCount ); i++ ) { nId = pPopupMenu->GetItemId( sal_uInt16( i )); - if ( nId != 0 && pPopupMenu->GetItemType( nId ) != MENUITEM_SEPARATOR ) + if ( nId != 0 && pPopupMenu->GetItemType( nId ) != MenuItemType::SEPARATOR ) { aCommand = pPopupMenu->GetItemCommand( nId ); if ( aCommand.startsWith( m_aEmptyDocURL ) ) @@ -149,7 +149,7 @@ void NewMenuController::determineAndSetNewDocAccel( PopupMenu* pPopupMenu, const for ( sal_uInt32 i = 0; i < sal_uInt32( nCount ); i++ ) { nId = pPopupMenu->GetItemId( sal_uInt16( i )); - if ( nId != 0 && pPopupMenu->GetItemType( nId ) != MENUITEM_SEPARATOR ) + if ( nId != 0 && pPopupMenu->GetItemType( nId ) != MenuItemType::SEPARATOR ) { aCommand = pPopupMenu->GetItemCommand( nId ); if ( aCommand.indexOf( aDefaultModuleName ) >= 0 ) @@ -225,7 +225,7 @@ void NewMenuController::setAccelerators( PopupMenu* pPopupMenu ) for ( sal_uInt32 i = 0; i < nItemCount; i++ ) { sal_uInt16 nId( pPopupMenu->GetItemId( sal_uInt16( i ))); - if ( nId && ( pPopupMenu->GetItemType( nId ) != MENUITEM_SEPARATOR )) + if ( nId && ( pPopupMenu->GetItemType( nId ) != MenuItemType::SEPARATOR )) { aIds.push_back( nId ); aMenuShortCuts.push_back( aEmptyKeyCode ); @@ -344,7 +344,7 @@ void NewMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu >& rPopup { sal_uInt16 nItemId = pSubMenu->GetItemId( sal::static_int_cast<sal_uInt16>( i ) ); if (( nItemId != 0 ) && - ( pSubMenu->GetItemType( nItemId ) != MENUITEM_SEPARATOR )) + ( pSubMenu->GetItemType( nItemId ) != MenuItemType::SEPARATOR )) { MenuConfiguration::Attributes* pBmkAttributes = reinterpret_cast<MenuConfiguration::Attributes *>(pSubMenu->GetUserValue( nItemId )); if ( pBmkAttributes != 0 ) diff --git a/include/rsc/rsc-vcl-shared-types.hxx b/include/rsc/rsc-vcl-shared-types.hxx index 66c12919ada9..5cda3c5622c3 100644 --- a/include/rsc/rsc-vcl-shared-types.hxx +++ b/include/rsc/rsc-vcl-shared-types.hxx @@ -32,8 +32,7 @@ enum KeyFuncType { KEYFUNC_DONTKNOW, KEYFUNC_NEW, KEYFUNC_OPEN, KEYFUNC_SAVE, KEYFUNC_FINDBACKWARD, KEYFUNC_PROPERTIES, KEYFUNC_FRONT, KeyFuncType_FORCE_EQUAL_SIZE=SAL_MAX_ENUM }; -enum MenuItemType { MENUITEM_DONTKNOW, MENUITEM_STRING, MENUITEM_IMAGE, - MENUITEM_STRINGIMAGE, MENUITEM_SEPARATOR }; +enum class MenuItemType { DONTKNOW, STRING, IMAGE, STRINGIMAGE, SEPARATOR }; typedef sal_uInt16 MenuItemBits; diff --git a/reportdesign/source/ui/dlg/Navigator.cxx b/reportdesign/source/ui/dlg/Navigator.cxx index 127e19125cd6..13c9daddf8e2 100644 --- a/reportdesign/source/ui/dlg/Navigator.cxx +++ b/reportdesign/source/ui/dlg/Navigator.cxx @@ -306,7 +306,7 @@ void NavigatorTree::Command( const CommandEvent& rEvt ) sal_uInt16 nCount = aContextMenu.GetItemCount(); for (sal_uInt16 i = 0; i < nCount; ++i) { - if ( MENUITEM_SEPARATOR != aContextMenu.GetItemType(i)) + if ( MenuItemType::SEPARATOR != aContextMenu.GetItemType(i)) { sal_uInt16 nId = aContextMenu.GetItemId(i); diff --git a/reportdesign/source/ui/report/ReportSection.cxx b/reportdesign/source/ui/report/ReportSection.cxx index 5d34c20fed59..7381ef6e78de 100644 --- a/reportdesign/source/ui/report/ReportSection.cxx +++ b/reportdesign/source/ui/report/ReportSection.cxx @@ -437,7 +437,7 @@ void lcl_insertMenuItemImages( const sal_uInt16 nCount = rContextMenu.GetItemCount(); for (sal_uInt16 i = 0; i < nCount; ++i) { - if ( MENUITEM_SEPARATOR != rContextMenu.GetItemType(i)) + if ( MenuItemType::SEPARATOR != rContextMenu.GetItemType(i)) { const sal_uInt16 nId = rContextMenu.GetItemId(i); PopupMenu* pPopupMenu = rContextMenu.GetPopupMenu( nId ); diff --git a/rsc/inc/rscdb.hxx b/rsc/inc/rscdb.hxx index a3d4befb45db..ff097bc0bcd1 100644 --- a/rsc/inc/rscdb.hxx +++ b/rsc/inc/rscdb.hxx @@ -28,7 +28,6 @@ #include <rscstr.hxx> #include <rscarray.hxx> #include <rscdef.hxx> -#include <rsc/rsc-vcl-shared-types.hxx> #include <vector> #include <map> @@ -37,6 +36,9 @@ class RscError; class RscTupel; class RscCont; class RscCmdLine; +enum class SymbolType : sal_uInt16; +enum class ToolBoxItemBits; +enum class WindowBorderStyle : sal_uInt16; struct WriteRcContext { diff --git a/sfx2/source/appl/sfxpicklist.cxx b/sfx2/source/appl/sfxpicklist.cxx index c36ebc45adbc..0a6959f80dc9 100644 --- a/sfx2/source/appl/sfxpicklist.cxx +++ b/sfx2/source/appl/sfxpicklist.cxx @@ -309,12 +309,12 @@ void SfxPickList::CreateMenuEntries( Menu* pMenu ) for ( sal_uInt16 nId = START_ITEMID_PICKLIST; nId <= END_ITEMID_PICKLIST; ++nId ) pMenu->RemoveItem( pMenu->GetItemPos( nId ) ); - if ( pMenu->GetItemType( pMenu->GetItemCount()-1 ) == MENUITEM_SEPARATOR ) + if ( pMenu->GetItemType( pMenu->GetItemCount()-1 ) == MenuItemType::SEPARATOR ) pMenu->RemoveItem( pMenu->GetItemCount()-1 ); if ( m_aPicklistVector.size() > 0 && pMenu->GetItemType( pMenu->GetItemCount()-1 ) - != MENUITEM_SEPARATOR && m_nAllowedMenuSize ) + != MenuItemType::SEPARATOR && m_nAllowedMenuSize ) pMenu->InsertSeparator(); OUString aEmptyString; diff --git a/sfx2/source/menu/mnuitem.cxx b/sfx2/source/menu/mnuitem.cxx index 838d1298c370..3bf7e24d5ca7 100644 --- a/sfx2/source/menu/mnuitem.cxx +++ b/sfx2/source/menu/mnuitem.cxx @@ -346,7 +346,7 @@ IMPL_LINK( SfxAppMenuControl_Impl, Activate, Menu *, pActMenu ) for ( sal_uInt16 nSVPos = 0; nSVPos < nCount; nSVPos++ ) { sal_uInt16 nItemId = pActMenu->GetItemId( nSVPos ); - if ( pActMenu->GetItemType( nSVPos ) != MENUITEM_SEPARATOR ) + if ( pActMenu->GetItemType( nSVPos ) != MenuItemType::SEPARATOR ) { if ( bShowMenuImages ) { diff --git a/sfx2/source/menu/virtmenu.cxx b/sfx2/source/menu/virtmenu.cxx index e6e4d8f1813a..7be7d806fb78 100644 --- a/sfx2/source/menu/virtmenu.cxx +++ b/sfx2/source/menu/virtmenu.cxx @@ -398,8 +398,8 @@ void SfxVirtualMenu::CreateFromSVMenu() { switch ( pSVMenu->GetItemType(nSVPos) ) { - case MENUITEM_STRING: - case MENUITEM_STRINGIMAGE: + case MenuItemType::STRING: + case MenuItemType::STRINGIMAGE: { SfxMenuControl *pMnuCtrl=0; OUString aCmd( pSVMenu->GetItemCommand( nSlotId ) ); @@ -465,11 +465,11 @@ void SfxVirtualMenu::CreateFromSVMenu() break; } - case MENUITEM_IMAGE: + case MenuItemType::IMAGE: //! not implemented break; - case MENUITEM_SEPARATOR: + case MenuItemType::SEPARATOR: //! not implemented break; default: @@ -501,9 +501,9 @@ IMPL_LINK_NOARG(SfxVirtualMenu, SettingsChanged) { for ( sal_uInt16 nSVPos=0; nSVPos<nItemCount; ++nSVPos ) { - sal_uInt16 nSlotId = pSVMenu->GetItemId( nSVPos ); + sal_uInt16 nSlotId = pSVMenu->GetItemId( nSVPos ); MenuItemType nType = pSVMenu->GetItemType( nSVPos ); - if ( nType == MENUITEM_STRING && bIcons ) + if ( nType == MenuItemType::STRING && bIcons ) { if ( framework::AddonMenuManager::IsAddonMenuId( nSlotId )) { @@ -526,7 +526,7 @@ IMPL_LINK_NOARG(SfxVirtualMenu, SettingsChanged) pSVMenu->SetItemImage( nSlotId, GetImage( xFrame, aSlotURL, false )); } } - else if( nType == MENUITEM_STRINGIMAGE && !bIcons ) + else if( nType == MenuItemType::STRINGIMAGE && !bIcons ) { pSVMenu->SetItemImage( nSlotId, Image() ); } @@ -575,7 +575,7 @@ void SfxVirtualMenu::UpdateImages( Menu* pMenu ) { sal_uInt16 nSlotId = pMenu->GetItemId( nPos ); PopupMenu* pPopup = pMenu->GetPopupMenu( nSlotId ); - if ( pMenu->GetItemType( nPos ) != MENUITEM_SEPARATOR ) + if ( pMenu->GetItemType( nPos ) != MenuItemType::SEPARATOR ) { OUString aImageId; @@ -609,7 +609,7 @@ void SfxVirtualMenu::RemoveMenuImages( Menu* pMenu ) { sal_uInt16 nSlotId = pMenu->GetItemId( nPos ); PopupMenu* pPopup = pMenu->GetPopupMenu( nSlotId ); - if ( pMenu->GetItemType( nPos ) == MENUITEM_STRINGIMAGE ) + if ( pMenu->GetItemType( nPos ) == MenuItemType::STRINGIMAGE ) pMenu->SetItemImage( nSlotId, Image() ); if ( pPopup ) RemoveMenuImages( pPopup ); @@ -756,7 +756,7 @@ void SfxVirtualMenu::InsertAddOnsMenuItem( Menu* pMenu ) { sal_uInt16 nItemCount = pMenu->GetItemCount(); OUString aAddonsTitle(SfxResId(STR_MENU_ADDONS).toString()); - if ( nItemCount > 0 && pMenu->GetItemType( nItemCount-1 ) != MENUITEM_SEPARATOR ) + if ( nItemCount > 0 && pMenu->GetItemType( nItemCount-1 ) != MenuItemType::SEPARATOR ) pMenu->InsertSeparator(); pMenu->InsertItem( SID_ADDONS, aAddonsTitle ); pMenu->SetPopupMenu( SID_ADDONS, pAddonMenu ); @@ -851,7 +851,7 @@ IMPL_LINK( SfxVirtualMenu, Activate, Menu *, pMenu ) for ( sal_uInt16 n = nPos; n < pMenu->GetItemCount(); ) pMenu->RemoveItem( n ); - if ( pMenu->GetItemType( pMenu->GetItemCount()-1 ) == MENUITEM_SEPARATOR ) + if ( pMenu->GetItemType( pMenu->GetItemCount()-1 ) == MenuItemType::SEPARATOR ) pMenu->RemoveItem( pMenu->GetItemCount()-1 ); } diff --git a/svtools/source/uno/contextmenuhelper.cxx b/svtools/source/uno/contextmenuhelper.cxx index b751f5a8a45e..9dd46c7fd2a7 100644 --- a/svtools/source/uno/contextmenuhelper.cxx +++ b/svtools/source/uno/contextmenuhelper.cxx @@ -574,7 +574,7 @@ ContextMenuHelper::completeMenuProperties( PopupMenu* pPopupMenu = pMenu->GetPopupMenu( nId ); if ( pPopupMenu ) completeMenuProperties( pPopupMenu ); - if ( pMenu->GetItemType( nPos ) != MENUITEM_SEPARATOR ) + if ( pMenu->GetItemType( nPos ) != MenuItemType::SEPARATOR ) { OUString aCmdURL( pMenu->GetItemCommand( nId )); diff --git a/vcl/osx/salmenu.cxx b/vcl/osx/salmenu.cxx index f7234496ae03..41e7711ebd03 100644 --- a/vcl/osx/salmenu.cxx +++ b/vcl/osx/salmenu.cxx @@ -906,7 +906,7 @@ AquaSalMenuItem::AquaSalMenuItem( const SalItemParams* pItemData ) : // Delete mnemonics OUString aText( comphelper::string::remove(pItemData->aText, '~') ); - if (pItemData->eType == MENUITEM_SEPARATOR) + if (pItemData->eType == MenuItemType::SEPARATOR) { mpMenuItem = [NSMenuItem separatorItem]; // these can go occasionally go in and out of a menu, ensure their lifecycle diff --git a/vcl/source/window/debugevent.cxx b/vcl/source/window/debugevent.cxx index b2b755303763..65a117223f21 100644 --- a/vcl/source/window/debugevent.cxx +++ b/vcl/source/window/debugevent.cxx @@ -68,7 +68,7 @@ static void CollectMenuItemIds( Menu *pMenu, MenuItemIds &rIds ) sal_uInt16 nItems = pMenu->GetItemCount(); for (sal_uInt16 i = 0; i < nItems; i++) { - if (pMenu->GetItemType( i ) != MENUITEM_SEPARATOR || getRandom() < 0.01) + if (pMenu->GetItemType( i ) != MenuItemType::SEPARATOR || getRandom() < 0.01) rIds.push_back( SalMenuEvent( pMenu->GetItemId( i ), pMenu ) ); PopupMenu *pPopup = pMenu->GetPopupMenu( i ); if (pPopup) diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx index 0f15f99e5e85..5ec2aa4d7418 100644 --- a/vcl/source/window/menu.cxx +++ b/vcl/source/window/menu.cxx @@ -103,11 +103,11 @@ static void ImplSetMenuItemData( MenuItemData* pData ) { // convert data if ( !pData->aImage ) - pData->eType = MENUITEM_STRING; + pData->eType = MenuItemType::STRING; else if ( pData->aText.isEmpty() ) - pData->eType = MENUITEM_IMAGE; + pData->eType = MenuItemType::IMAGE; else - pData->eType = MENUITEM_STRINGIMAGE; + pData->eType = MenuItemType::STRINGIMAGE; } Menu::Menu() @@ -382,7 +382,7 @@ void Menu::InsertItem(sal_uInt16 nItemId, const OUString& rStr, MenuItemBits nIt nPos = MENU_APPEND; // put Item in MenuItemList - MenuItemData* pData = pItemList->Insert(nItemId, MENUITEM_STRING, + MenuItemData* pData = pItemList->Insert(nItemId, MenuItemType::STRING, nItemBits, rStr, Image(), this, nPos, rIdent); // update native menu @@ -576,10 +576,10 @@ void ImplCopyItem( Menu* pThis, const Menu& rMenu, sal_uInt16 nPos, sal_uInt16 n { MenuItemType eType = rMenu.GetItemType( nPos ); - if ( eType == MENUITEM_DONTKNOW ) + if ( eType == MenuItemType::DONTKNOW ) return; - if ( eType == MENUITEM_SEPARATOR ) + if ( eType == MenuItemType::SEPARATOR ) pThis->InsertSeparator( OString(), nNewPos ); else { @@ -593,9 +593,9 @@ void ImplCopyItem( Menu* pThis, const Menu& rMenu, sal_uInt16 nPos, sal_uInt16 n if (!pData) return; - if ( eType == MENUITEM_STRINGIMAGE ) + if ( eType == MenuItemType::STRINGIMAGE ) pThis->InsertItem( nId, pData->aText, pData->aImage, pData->nBits, pData->sIdent, nNewPos ); - else if ( eType == MENUITEM_STRING ) + else if ( eType == MenuItemType::STRING ) pThis->InsertItem( nId, pData->aText, pData->nBits, pData->sIdent, nNewPos ); else pThis->InsertItem( nId, pData->aImage, pData->nBits, pData->sIdent, nNewPos ); @@ -721,7 +721,7 @@ MenuItemType Menu::GetItemType( sal_uInt16 nPos ) const if ( pData ) return pData->eType; else - return MENUITEM_DONTKNOW; + return MenuItemType::DONTKNOW; } OString Menu::GetCurItemIdent() const @@ -1266,7 +1266,7 @@ bool Menu::ImplIsVisible( sal_uInt16 nPos ) const if( pData && !pData->bVisible ) bVisible = false; - if ( bVisible && pData && pData->eType == MENUITEM_SEPARATOR ) + if ( bVisible && pData && pData->eType == MenuItemType::SEPARATOR ) { if( nPos == 0 ) // no separator should be shown at the very beginning bVisible = false; @@ -1282,14 +1282,14 @@ bool Menu::ImplIsVisible( sal_uInt16 nPos ) const pNextData = pItemList->GetDataFromPos( n ); if( pNextData && pNextData->bVisible ) { - if( pNextData->eType == MENUITEM_SEPARATOR || ImplIsVisible(n) ) + if( pNextData->eType == MenuItemType::SEPARATOR || ImplIsVisible(n) ) break; } } if( n == nCount ) // no next visible item bVisible = false; // check for separator - if( pNextData && pNextData->bVisible && pNextData->eType == MENUITEM_SEPARATOR ) + if( pNextData && pNextData->bVisible && pNextData->eType == MenuItemType::SEPARATOR ) bVisible = false; if( bVisible ) @@ -1299,7 +1299,7 @@ bool Menu::ImplIsVisible( sal_uInt16 nPos ) const pNextData = pItemList->GetDataFromPos( n-1 ); if( pNextData && pNextData->bVisible ) { - if( pNextData->eType != MENUITEM_SEPARATOR && ImplIsVisible(n-1) ) + if( pNextData->eType != MenuItemType::SEPARATOR && ImplIsVisible(n-1) ) break; } } @@ -1316,7 +1316,7 @@ bool Menu::ImplIsVisible( sal_uInt16 nPos ) const { if( !pData ) // e.g. nPos == ITEMPOS_INVALID bVisible = false; - else if ( pData->eType != MENUITEM_SEPARATOR ) // separators handled above + else if ( pData->eType != MenuItemType::SEPARATOR ) // separators handled above { // bVisible = pData->bEnabled && ( !pData->pSubMenu || pData->pSubMenu->HasValidEntries( true ) ); bVisible = pData->bEnabled; // do not check submenus as they might be filled at Activate(). @@ -1519,8 +1519,8 @@ Size Menu::ImplCalcSize( const vcl::Window* pWin ) { MenuItemData* pData = pItemList->GetDataFromPos( --i ); if ( ImplIsVisible( i ) - && ( ( pData->eType == MENUITEM_IMAGE ) - || ( pData->eType == MENUITEM_STRINGIMAGE ) + && ( ( pData->eType == MenuItemType::IMAGE ) + || ( pData->eType == MenuItemType::STRINGIMAGE ) ) ) { @@ -1550,14 +1550,14 @@ Size Menu::ImplCalcSize( const vcl::Window* pWin ) long nWidth = 0; // Separator - if (!IsMenuBar()&& (pData->eType == MENUITEM_SEPARATOR)) + if (!IsMenuBar()&& (pData->eType == MenuItemType::SEPARATOR)) { DBG_ASSERT( !IsMenuBar(), "Separator in MenuBar ?! " ); pData->aSz.Height() = 4; } // Image: - if (!IsMenuBar()&& ((pData->eType == MENUITEM_IMAGE) || (pData->eType == MENUITEM_STRINGIMAGE))) + if (!IsMenuBar()&& ((pData->eType == MenuItemType::IMAGE) || (pData->eType == MenuItemType::STRINGIMAGE))) { Size aImgSz = pData->aImage.GetSizePixel(); aImgSz.Height() += 4; // add a border for native marks @@ -1575,12 +1575,12 @@ Size Menu::ImplCalcSize( const vcl::Window* pWin ) { nCheckWidth = aMaxSize.Width(); // checks / images take the same place - if( ! ( ( pData->eType == MENUITEM_IMAGE ) || ( pData->eType == MENUITEM_STRINGIMAGE ) ) ) + if( ! ( ( pData->eType == MenuItemType::IMAGE ) || ( pData->eType == MenuItemType::STRINGIMAGE ) ) ) nWidth += nCheckWidth + nExtra * 2; } // Text: - if ( (pData->eType == MENUITEM_STRING) || (pData->eType == MENUITEM_STRINGIMAGE) ) + if ( (pData->eType == MenuItemType::STRING) || (pData->eType == MenuItemType::STRINGIMAGE) ) { long nTextWidth = pWin->GetCtrlTextWidth( pData->aText ); long nTextHeight = pWin->GetTextHeight(); @@ -1811,7 +1811,7 @@ void Menu::ImplPaint( vcl::Window* pWin, sal_uInt16 nBorder, long nStartY, MenuI } // Separator - if (!bLayout && !IsMenuBar() && (pData->eType == MENUITEM_SEPARATOR)) + if (!bLayout && !IsMenuBar() && (pData->eType == MenuItemType::SEPARATOR)) { bool bNativeOk = false; if( pWin->IsNativeControlSupported( CTRL_MENU_POPUP, @@ -1860,7 +1860,7 @@ void Menu::ImplPaint( vcl::Window* pWin, sal_uInt16 nBorder, long nStartY, MenuI // however do not do this if native checks will be painted since // the selection color too often does not fit the theme's check and/or radio - if( ! ( ( pData->eType == MENUITEM_IMAGE ) || ( pData->eType == MENUITEM_STRINGIMAGE ) ) ) + if( ! ( ( pData->eType == MenuItemType::IMAGE ) || ( pData->eType == MenuItemType::STRINGIMAGE ) ) ) { if ( pWin->IsNativeControlSupported( CTRL_MENU_POPUP, (pData->nBits & MIB_RADIOCHECK) @@ -1922,7 +1922,7 @@ void Menu::ImplPaint( vcl::Window* pWin, sal_uInt16 nBorder, long nStartY, MenuI } // Image: - if (!bLayout && !IsMenuBar() && ((pData->eType == MENUITEM_IMAGE) || (pData->eType == MENUITEM_STRINGIMAGE))) + if (!bLayout && !IsMenuBar() && ((pData->eType == MenuItemType::IMAGE) || (pData->eType == MenuItemType::STRINGIMAGE))) { // Don't render an image for a check thing if( pData->bChecked ) @@ -1934,7 +1934,7 @@ void Menu::ImplPaint( vcl::Window* pWin, sal_uInt16 nBorder, long nStartY, MenuI } // Text: - if ( ( pData->eType == MENUITEM_STRING ) || ( pData->eType == MENUITEM_STRINGIMAGE ) ) + if ( ( pData->eType == MenuItemType::STRING ) || ( pData->eType == MenuItemType::STRINGIMAGE ) ) { aTmpPos.X() = aPos.X() + nTextPos; aTmpPos.Y() = aPos.Y(); @@ -2171,9 +2171,9 @@ void Menu::RemoveDisabledEntries( bool bCheckPopups, bool bRemoveEmptyPopups ) { bool bRemove = false; MenuItemData* pItem = pItemList->GetDataFromPos( n ); - if ( pItem->eType == MENUITEM_SEPARATOR ) + if ( pItem->eType == MenuItemType::SEPARATOR ) { - if ( !n || ( GetItemType( n-1 ) == MENUITEM_SEPARATOR ) ) + if ( !n || ( GetItemType( n-1 ) == MenuItemType::SEPARATOR ) ) bRemove = true; } else @@ -2194,7 +2194,7 @@ void Menu::RemoveDisabledEntries( bool bCheckPopups, bool bRemoveEmptyPopups ) { sal_uInt16 nLast = GetItemCount() - 1; MenuItemData* pItem = pItemList->GetDataFromPos( nLast ); - if ( pItem->eType == MENUITEM_SEPARATOR ) + if ( pItem->eType == MenuItemType::SEPARATOR ) RemoveItem( nLast ); } delete mpLayoutData, mpLayoutData = NULL; @@ -2207,7 +2207,7 @@ bool Menu::HasValidEntries( bool bCheckPopups ) for ( sal_uInt16 n = 0; !bValidEntries && ( n < nCount ); n++ ) { MenuItemData* pItem = pItemList->GetDataFromPos( n ); - if ( pItem->bEnabled && ( pItem->eType != MENUITEM_SEPARATOR ) ) + if ( pItem->bEnabled && ( pItem->eType != MenuItemType::SEPARATOR ) ) { if ( bCheckPopups && pItem->pSubMenu ) bValidEntries = pItem->pSubMenu->HasValidEntries( true ); @@ -2862,7 +2862,7 @@ sal_uInt16 PopupMenu::ImplExecute( vcl::Window* pW, const Rectangle& rRect, sal_ { OUString aTmpEntryText( ResId( SV_RESID_STRING_NOSELECTIONPOSSIBLE, *pResMgr ) ); MenuItemData* pData = pItemList->Insert( - 0xFFFF, MENUITEM_STRING, 0, aTmpEntryText, Image(), NULL, 0xFFFF, OString() ); + 0xFFFF, MenuItemType::STRING, 0, aTmpEntryText, Image(), NULL, 0xFFFF, OString() ); size_t nPos = 0; pData = pItemList->GetData( pData->nId, nPos ); assert(pData); @@ -2975,7 +2975,7 @@ sal_uInt16 PopupMenu::ImplExecute( vcl::Window* pW, const Rectangle& rRect, sal_ if ( ( pData->bEnabled || !Application::GetSettings().GetStyleSettings().GetSkipDisabledInMenus() ) - && ( pData->eType != MENUITEM_SEPARATOR ) + && ( pData->eType != MenuItemType::SEPARATOR ) && ImplIsVisible( n ) && ImplIsSelectable( n ) ) diff --git a/vcl/source/window/menubarwindow.cxx b/vcl/source/window/menubarwindow.cxx index 63011d297395..ebbfeecc6881 100644 --- a/vcl/source/window/menubarwindow.cxx +++ b/vcl/source/window/menubarwindow.cxx @@ -582,7 +582,7 @@ void MenuBarWindow::HighlightItem( sal_uInt16 nPos, bool bHighlight ) MenuItemData* pData = pMenu->pItemList->GetDataFromPos( n ); if ( n == nPos ) { - if ( pData->eType != MENUITEM_SEPARATOR ) + if ( pData->eType != MenuItemType::SEPARATOR ) { // #107747# give menuitems the height of the menubar Rectangle aRect = Rectangle( Point( nX, 1 ), Size( pData->aSz.Width(), GetOutputSizePixel().Height()-2 ) ); @@ -681,7 +681,7 @@ Rectangle MenuBarWindow::ImplGetItemRect( sal_uInt16 nPos ) MenuItemData* pData = pMenu->pItemList->GetDataFromPos( n ); if ( n == nPos ) { - if ( pData->eType != MENUITEM_SEPARATOR ) + if ( pData->eType != MenuItemType::SEPARATOR ) // #107747# give menuitems the height of the menubar aRect = Rectangle( Point( nX, 1 ), Size( pData->aSz.Width(), GetOutputSizePixel().Height()-2 ) ); break; @@ -785,7 +785,7 @@ bool MenuBarWindow::HandleKeyEvent( const KeyEvent& rKEvent, bool bFromMenu ) } MenuItemData* pData = (MenuItemData*)pMenu->GetItemList()->GetDataFromPos( n ); - if ( ( pData->eType != MENUITEM_SEPARATOR ) && pMenu->ImplIsVisible( n ) ) + if ( ( pData->eType != MenuItemType::SEPARATOR ) && pMenu->ImplIsVisible( n ) ) { bool bDoSelect = true; if( ImplGetSVData()->maNWFData.mbOpenMenuOnF10 ) diff --git a/vcl/source/window/menufloatingwindow.cxx b/vcl/source/window/menufloatingwindow.cxx index a61345af1e62..e3a7c13c7d7c 100644 --- a/vcl/source/window/menufloatingwindow.cxx +++ b/vcl/source/window/menufloatingwindow.cxx @@ -501,7 +501,7 @@ void MenuFloatingWindow::MouseButtonUp( const MouseEvent& rMEvt ) // as it will be too late after EndExecute sal_uInt16 _nMBDownPos = nMBDownPos; nMBDownPos = ITEMPOS_INVALID; - if ( pData && pData->bEnabled && ( pData->eType != MENUITEM_SEPARATOR ) ) + if ( pData && pData->bEnabled && ( pData->eType != MenuItemType::SEPARATOR ) ) { if ( !pData->pSubMenu ) { @@ -731,7 +731,7 @@ void MenuFloatingWindow::HighlightItem( sal_uInt16 nPos, bool bHighlight ) if ( n == nPos ) { DBG_ASSERT( pMenu->ImplIsVisible( n ), "Highlight: Item not visible!" ); - if ( pData->eType != MENUITEM_SEPARATOR ) + if ( pData->eType != MenuItemType::SEPARATOR ) { bool bRestoreLineColor = false; Color oldLineColor; @@ -824,7 +824,7 @@ Rectangle MenuFloatingWindow::ImplGetItemRect( sal_uInt16 nPos ) if ( n == nPos ) { DBG_ASSERT( pMenu->ImplIsVisible( n ), "ImplGetItemRect: Item not visible!" ); - if ( pData->eType != MENUITEM_SEPARATOR ) + if ( pData->eType != MenuItemType::SEPARATOR ) { aRect = Rectangle( Point( nX, nY ), Size( aSz.Width(), pData->aSz.Height() ) ); if ( pData->nBits & MIB_POPUPSELECT ) @@ -899,7 +899,7 @@ void MenuFloatingWindow::ImplCursorUpDown( bool bUp, bool bHomeEnd ) MenuItemData* pData = (MenuItemData*)pMenu->GetItemList()->GetDataFromPos( n ); if ( ( pData->bEnabled || !rSettings.GetSkipDisabledInMenus() ) - && ( pData->eType != MENUITEM_SEPARATOR ) && pMenu->ImplIsVisible( n ) && pMenu->ImplIsSelectable( n ) ) + && ( pData->eType != MenuItemType::SEPARATOR ) && pMenu->ImplIsVisible( n ) && pMenu->ImplIsSelectable( n ) ) { // Is selection in visible area? if ( IsScrollMenu() ) diff --git a/vcl/source/window/menuitemlist.cxx b/vcl/source/window/menuitemlist.cxx index 10129d468885..505bdf72e98b 100644 --- a/vcl/source/window/menuitemlist.cxx +++ b/vcl/source/window/menuitemlist.cxx @@ -98,7 +98,7 @@ void MenuItemList::InsertSeparator(const OString &rIdent, size_t nPos) MenuItemData* pData = new MenuItemData; pData->nId = 0; pData->sIdent = rIdent; - pData->eType = MENUITEM_SEPARATOR; + pData->eType = MenuItemType::SEPARATOR; pData->nBits = 0; pData->pSubMenu = NULL; pData->pAutoSubMenu = NULL; @@ -112,7 +112,7 @@ void MenuItemList::InsertSeparator(const OString &rIdent, size_t nPos) SalItemParams aSalMIData; aSalMIData.nId = 0; - aSalMIData.eType = MENUITEM_SEPARATOR; + aSalMIData.eType = MenuItemType::SEPARATOR; aSalMIData.nBits = 0; aSalMIData.pMenu = NULL; aSalMIData.aText = OUString(); diff --git a/vcl/source/window/menuitemlist.hxx b/vcl/source/window/menuitemlist.hxx index 27f138efb4d1..da69193770db 100644 --- a/vcl/source/window/menuitemlist.hxx +++ b/vcl/source/window/menuitemlist.hxx @@ -59,7 +59,7 @@ struct MenuItemData MenuItemData() : nId(0) - , eType(MENUITEM_DONTKNOW) + , eType(MenuItemType::DONTKNOW) , nBits(0) , pSubMenu(NULL) , pAutoSubMenu(NULL) @@ -75,7 +75,7 @@ struct MenuItemData } MenuItemData( const OUString& rStr, const Image& rImage ) : nId(0) - , eType(MENUITEM_DONTKNOW) + , eType(MenuItemType::DONTKNOW) , nBits(0) , pSubMenu(NULL) , pAutoSubMenu(NULL) diff --git a/vcl/unx/gtk/window/gtksalmenu.cxx b/vcl/unx/gtk/window/gtksalmenu.cxx index 7a56ad63ad7b..676e68c5f5a5 100644 --- a/vcl/unx/gtk/window/gtksalmenu.cxx +++ b/vcl/unx/gtk/window/gtksalmenu.cxx @@ -284,7 +284,7 @@ void GtkSalMenu::ImplUpdate( gboolean bRecurse ) GtkSalMenuItem *pSalMenuItem = GetItemAtPos( nItem ); sal_uInt16 nId = pSalMenuItem->mnId; - if ( pSalMenuItem->mnType == MENUITEM_SEPARATOR ) + if ( pSalMenuItem->mnType == MenuItemType::SEPARATOR ) { // Delete extra items from current section. RemoveSpareItemsFromNativeMenu( pLOMenu, &pOldCommandList, nSection, validItems ); diff --git a/vcl/win/source/window/salmenu.cxx b/vcl/win/source/window/salmenu.cxx index 7deb54b04b76..422701a6865e 100644 --- a/vcl/win/source/window/salmenu.cxx +++ b/vcl/win/source/window/salmenu.cxx @@ -79,7 +79,7 @@ SalMenuItem* WinSalInstance::CreateMenuItem( const SalItemParams* pItemData ) memset( &pSalMenuItem->mInfo, 0, sizeof( MENUITEMINFOW ) ); pSalMenuItem->mInfo.cbSize = sizeof( MENUITEMINFOW ); - if( pItemData->eType == MENUITEM_SEPARATOR ) + if( pItemData->eType == MenuItemType::SEPARATOR ) { // separator pSalMenuItem->mInfo.fMask = MIIM_TYPE; |