From 035fe8a6aa6489740a7c9f4e1768452319a686d3 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Tue, 21 Oct 2014 08:39:46 +0200 Subject: fdo#84938: replace MENUITEM constants with enum Change-Id: I7b0085af3b13bd6e1a50bf1e0e986d1524b52d7b --- framework/source/classes/menumanager.cxx | 12 ++++++------ framework/source/fwe/classes/addonmenu.cxx | 6 +++--- framework/source/fwe/helper/actiontriggerhelper.cxx | 2 +- framework/source/uielement/menubarmanager.cxx | 10 +++++----- framework/source/uielement/newmenucontroller.cxx | 8 ++++---- 5 files changed, 19 insertions(+), 19 deletions(-) (limited to 'framework') 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(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( i ) ); if (( nItemId != 0 ) && - ( pSubMenu->GetItemType( nItemId ) != MENUITEM_SEPARATOR )) + ( pSubMenu->GetItemType( nItemId ) != MenuItemType::SEPARATOR )) { MenuConfiguration::Attributes* pBmkAttributes = reinterpret_cast(pSubMenu->GetUserValue( nItemId )); if ( pBmkAttributes != 0 ) -- cgit