summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2014-11-01 14:50:30 +0200
committerNoel Grandin <noelgrandin@gmail.com>2014-11-01 14:53:39 +0000
commita7542d38ddeebd37ddea233fa1e4cf15b2e03c49 (patch)
tree07ec3f89a4487b42c8b8203fab9e4dbb6f394a9c
parentb812374174144e077bc3b08fe347626cb1a33eee (diff)
fdo#84938: replace MIB_ constants with enum
Change-Id: I58c1b4c9e4c4b3751b233d2fe10b9c953b945c4a Reviewed-on: https://gerrit.libreoffice.org/12179 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
-rw-r--r--accessibility/source/standard/vclxaccessiblemenuitem.cxx4
-rw-r--r--dbaccess/source/ui/browser/sbagrid.cxx10
-rw-r--r--editeng/source/editeng/editview.cxx4
-rw-r--r--framework/source/classes/menumanager.cxx6
-rw-r--r--framework/source/fwe/classes/addonmenu.cxx4
-rw-r--r--framework/source/uielement/fontsizemenucontroller.cxx6
-rw-r--r--framework/source/uielement/headermenucontroller.cxx4
-rw-r--r--framework/source/uielement/menubarmanager.cxx14
-rw-r--r--framework/source/uielement/menubarmerger.cxx2
-rw-r--r--framework/source/uielement/recentfilesmenucontroller.cxx2
-rw-r--r--framework/source/uielement/toolbarmanager.cxx2
-rw-r--r--include/rsc/rsc-vcl-shared-types.hxx31
-rw-r--r--include/svtools/toolbarmenu.hxx6
-rw-r--r--include/vcl/menu.hxx6
-rw-r--r--rsc/inc/rscdb.hxx3
-rw-r--r--rsc/source/parser/rscicpx.cxx10
-rw-r--r--sc/source/ui/view/tabcont.cxx2
-rw-r--r--sd/source/ui/app/sdpopup.cxx2
-rw-r--r--sfx2/source/dialog/taskpane.cxx6
-rw-r--r--sfx2/source/menu/mnuitem.cxx4
-rw-r--r--sfx2/source/menu/mnumgr.cxx2
-rw-r--r--sfx2/source/menu/virtmenu.cxx2
-rw-r--r--sfx2/source/sidebar/SidebarController.cxx8
-rw-r--r--svtools/source/control/stdmenu.cxx8
-rw-r--r--svtools/source/control/toolbarmenu.cxx16
-rw-r--r--svtools/source/control/toolbarmenuimp.hxx2
-rw-r--r--svx/source/fmcomp/fmgridcl.cxx2
-rw-r--r--svx/source/form/datanavi.cxx2
-rw-r--r--svx/source/mnuctrls/SmartTagCtl.cxx6
-rw-r--r--svx/source/tbxctrls/fontworkgallery.cxx14
-rw-r--r--sw/source/uibase/lingu/olmenu.cxx20
-rw-r--r--sw/source/uibase/smartmenu/stmenu.cxx6
-rw-r--r--vcl/source/control/tabctrl.cxx2
-rw-r--r--vcl/source/window/builder.cxx2
-rw-r--r--vcl/source/window/menu.cxx34
-rw-r--r--vcl/source/window/menufloatingwindow.cxx10
-rw-r--r--vcl/source/window/menuitemlist.cxx4
-rw-r--r--vcl/source/window/menuitemlist.hxx6
-rw-r--r--vcl/source/window/toolbox2.cxx4
-rw-r--r--vcl/unx/gtk/window/gtksalmenu.cxx6
40 files changed, 146 insertions, 138 deletions
diff --git a/accessibility/source/standard/vclxaccessiblemenuitem.cxx b/accessibility/source/standard/vclxaccessiblemenuitem.cxx
index 95c59ebe4b4d..cf4d2f3557fc 100644
--- a/accessibility/source/standard/vclxaccessiblemenuitem.cxx
+++ b/accessibility/source/standard/vclxaccessiblemenuitem.cxx
@@ -190,9 +190,9 @@ sal_Int16 VCLXAccessibleMenuItem::getAccessibleRole( ) throw (RuntimeException,
{
sal_uInt16 nItemId = m_pParent->GetItemId( m_nItemPos );
MenuItemBits nItemBits = m_pParent->GetItemBits(nItemId);
- if( nItemBits & MIB_RADIOCHECK)
+ if( nItemBits & MenuItemBits::RADIOCHECK)
nRole = AccessibleRole::RADIO_MENU_ITEM;
- else if( nItemBits & MIB_CHECKABLE)
+ else if( nItemBits & MenuItemBits::CHECKABLE)
nRole = AccessibleRole::CHECK_MENU_ITEM;
}
return nRole;
diff --git a/dbaccess/source/ui/browser/sbagrid.cxx b/dbaccess/source/ui/browser/sbagrid.cxx
index abfe3bdbe229..cf86c83d0b36 100644
--- a/dbaccess/source/ui/browser/sbagrid.cxx
+++ b/dbaccess/source/ui/browser/sbagrid.cxx
@@ -661,13 +661,13 @@ void SbaGridHeader::PreExecuteColumnContextMenu(sal_uInt16 nColId, PopupMenu& rM
case DataType::REF:
break;
default:
- rMenu.InsertItem(ID_BROWSER_COLATTRSET, aNewItems.GetItemText(ID_BROWSER_COLATTRSET), 0, OString(), nPos++);
+ rMenu.InsertItem(ID_BROWSER_COLATTRSET, aNewItems.GetItemText(ID_BROWSER_COLATTRSET), MenuItemBits::NONE, OString(), nPos++);
rMenu.SetHelpId(ID_BROWSER_COLATTRSET, aNewItems.GetHelpId(ID_BROWSER_COLATTRSET));
rMenu.InsertSeparator(OString(), nPos++);
}
}
- rMenu.InsertItem(ID_BROWSER_COLWIDTH, aNewItems.GetItemText(ID_BROWSER_COLWIDTH), 0, OString(), nPos++);
+ rMenu.InsertItem(ID_BROWSER_COLWIDTH, aNewItems.GetItemText(ID_BROWSER_COLWIDTH), MenuItemBits::NONE, OString(), nPos++);
rMenu.SetHelpId(ID_BROWSER_COLWIDTH, aNewItems.GetHelpId(ID_BROWSER_COLWIDTH));
rMenu.InsertSeparator(OString(), nPos++);
}
@@ -743,17 +743,17 @@ void SbaGridControl::PreExecuteRowContextMenu(sal_uInt16 nRow, PopupMenu& rMenu)
if (!IsReadOnlyDB())
{
- rMenu.InsertItem(ID_BROWSER_TABLEATTR, aNewItems.GetItemText(ID_BROWSER_TABLEATTR), 0, OString(), nPos++);
+ rMenu.InsertItem(ID_BROWSER_TABLEATTR, aNewItems.GetItemText(ID_BROWSER_TABLEATTR), MenuItemBits::NONE, OString(), nPos++);
rMenu.SetHelpId(ID_BROWSER_TABLEATTR, aNewItems.GetHelpId(ID_BROWSER_TABLEATTR));
- rMenu.InsertItem(ID_BROWSER_ROWHEIGHT, aNewItems.GetItemText(ID_BROWSER_ROWHEIGHT), 0, OString(), nPos++);
+ rMenu.InsertItem(ID_BROWSER_ROWHEIGHT, aNewItems.GetItemText(ID_BROWSER_ROWHEIGHT), MenuItemBits::NONE, OString(), nPos++);
rMenu.SetHelpId(ID_BROWSER_ROWHEIGHT, aNewItems.GetHelpId(ID_BROWSER_ROWHEIGHT));
rMenu.InsertSeparator(OString(), nPos++);
}
if ( GetSelectRowCount() > 0 )
{
- rMenu.InsertItem(ID_BROWSER_COPY, aNewItems.GetItemText(SID_COPY), 0, OString(), nPos++);
+ rMenu.InsertItem(ID_BROWSER_COPY, aNewItems.GetItemText(SID_COPY), MenuItemBits::NONE, OString(), nPos++);
rMenu.SetHelpId(ID_BROWSER_COPY, aNewItems.GetHelpId(SID_COPY));
rMenu.InsertSeparator(OString(), nPos++);
diff --git a/editeng/source/editeng/editview.cxx b/editeng/source/editeng/editview.cxx
index d86ee0ab3264..c10fd5510d92 100644
--- a/editeng/source/editeng/editview.cxx
+++ b/editeng/source/editeng/editview.cxx
@@ -840,8 +840,8 @@ void EditView::ExecuteSpellPopup( const Point& rPosPixel, Link* pCallBack )
for ( sal_uInt16 nW = 0; nW < nWords; nW++ )
{
OUString aAlternate( pAlt[nW] );
- aPopupMenu.InsertItem( MN_ALTSTART+nW, aAlternate, 0, OString(), nW );
- pAutoMenu->InsertItem( MN_AUTOSTART+nW, aAlternate, 0, OString(), nW );
+ aPopupMenu.InsertItem( MN_ALTSTART+nW, aAlternate, MenuItemBits::NONE, OString(), nW );
+ pAutoMenu->InsertItem( MN_AUTOSTART+nW, aAlternate, MenuItemBits::NONE, OString(), nW );
}
aPopupMenu.InsertSeparator(OString(), nWords);
}
diff --git a/framework/source/classes/menumanager.cxx b/framework/source/classes/menumanager.cxx
index 9943a4d55e4c..7a7d73fc3951 100644
--- a/framework/source/classes/menumanager.cxx
+++ b/framework/source/classes/menumanager.cxx
@@ -133,7 +133,7 @@ MenuManager::MenuManager(
if (!bShowMenuImages)
{
MenuItemBits nBits = pMenu->GetItemBits( nItemId );
- bShowMenuImages = ( ( nBits & MIB_ICON ) == MIB_ICON );
+ bShowMenuImages = ( ( nBits & MenuItemBits::ICON ) == MenuItemBits::ICON );
}
PopupMenu* pPopupMenu = pMenu->GetPopupMenu( nItemId );
@@ -659,7 +659,7 @@ void MenuManager::UpdateSpecialWindowMenu( Menu* pMenu,const Reference< XCompone
const sal_uInt32 nCount = aNewWindowListVector.size();
for ( sal_uInt32 i = 0; i < nCount; i++ )
{
- pMenu->InsertItem( nItemId, aNewWindowListVector.at( i ), MIB_RADIOCHECK );
+ pMenu->InsertItem( nItemId, aNewWindowListVector.at( i ), MenuItemBits::RADIOCHECK );
if ( nItemId == nActiveItemId )
pMenu->CheckItem( nItemId );
++nItemId;
@@ -935,7 +935,7 @@ void MenuManager::FillMenuImages(Reference< XFrame >& _xFrame, Menu* _pMenu,bool
if (!bTmpShowMenuImages)
{
MenuItemBits nBits = _pMenu->GetItemBits( nId );
- bTmpShowMenuImages = ( ( nBits & MIB_ICON ) == MIB_ICON );
+ bTmpShowMenuImages = ( ( nBits & MenuItemBits::ICON ) == MenuItemBits::ICON );
}
if ( bTmpShowMenuImages )
diff --git a/framework/source/fwe/classes/addonmenu.cxx b/framework/source/fwe/classes/addonmenu.cxx
index 86a3ebeef1e3..836caa87af46 100644
--- a/framework/source/fwe/classes/addonmenu.cxx
+++ b/framework/source/fwe/classes/addonmenu.cxx
@@ -256,7 +256,7 @@ void AddonMenuManager::MergeAddonPopupMenus( const Reference< XFrame >& rFrame,
if ( pAddonPopupMenu->GetItemCount() > 0 )
{
pAddonPopupMenu->SetCommandURL( aURL );
- pMergeMenuBar->InsertItem( nId, aTitle, 0, OString(), nInsertPos++ );
+ pMergeMenuBar->InsertItem( nId, aTitle, MenuItemBits::NONE, OString(), nInsertPos++ );
pMergeMenuBar->SetPopupMenu( nId, pAddonPopupMenu );
// Store the command URL into the VCL menu bar for later identification
@@ -328,7 +328,7 @@ void AddonMenuManager::BuildMenu( PopupMenu* pCurrent
}
sal_uInt16 nId = nUniqueMenuId++;
- pCurrentMenu->InsertItem(nId, aTitle, 0, OString(), nInsPos);
+ pCurrentMenu->InsertItem(nId, aTitle, MenuItemBits::NONE, OString(), nInsPos);
nInsPos = AddonMenuManager::GetNextPos( nInsPos );
++nElements;
diff --git a/framework/source/uielement/fontsizemenucontroller.cxx b/framework/source/uielement/fontsizemenucontroller.cxx
index 88dd46e62cab..3e097655c9ab 100644
--- a/framework/source/uielement/fontsizemenucontroller.cxx
+++ b/framework/source/uielement/fontsizemenucontroller.cxx
@@ -185,7 +185,7 @@ void FontSizeMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu >& r
long nSize = aFontSizeNames.GetIndexSize( i );
m_pHeightArray[nPos] = nSize;
nPos++; // Id is nPos+1
- pVCLPopupMenu->InsertItem( nPos, aSizeName, MIB_RADIOCHECK | MIB_AUTOCHECK );
+ pVCLPopupMenu->InsertItem( nPos, aSizeName, MenuItemBits::RADIOCHECK | MenuItemBits::AUTOCHECK );
fPoint = float( m_pHeightArray[nPos-1] ) / 10;
// Create dispatchable .uno command and set it
@@ -204,7 +204,7 @@ void FontSizeMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu >& r
{
m_pHeightArray[nPos] = *pTempAry;
nPos++; // Id is nPos+1
- pVCLPopupMenu->InsertItem( nPos, aSizeName, MIB_RADIOCHECK | MIB_AUTOCHECK );
+ pVCLPopupMenu->InsertItem( nPos, aSizeName, MenuItemBits::RADIOCHECK | MenuItemBits::AUTOCHECK );
fPoint = float( m_pHeightArray[nPos-1] ) / 10;
// Create dispatchable .uno command and set it
@@ -223,7 +223,7 @@ void FontSizeMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu >& r
{
m_pHeightArray[nPos] = *pTempAry;
nPos++; // Id is nPos+1
- pVCLPopupMenu->InsertItem( nPos, rI18nHelper.GetNum( *pTempAry, 1, true, false ), MIB_RADIOCHECK | MIB_AUTOCHECK );
+ pVCLPopupMenu->InsertItem( nPos, rI18nHelper.GetNum( *pTempAry, 1, true, false ), MenuItemBits::RADIOCHECK | MenuItemBits::AUTOCHECK );
fPoint = float( m_pHeightArray[nPos-1] ) / 10;
// Create dispatchable .uno command and set it
diff --git a/framework/source/uielement/headermenucontroller.cxx b/framework/source/uielement/headermenucontroller.cxx
index 6e9cdd5e6ede..0d9424e513cc 100644
--- a/framework/source/uielement/headermenucontroller.cxx
+++ b/framework/source/uielement/headermenucontroller.cxx
@@ -134,7 +134,7 @@ void HeaderMenuController::fillPopupMenu( const Reference< ::com::sun::star::fra
else
aStrBuf.appendAscii( "false" );
OUString aCommand( aStrBuf.makeStringAndClear() );
- pVCLPopupMenu->InsertItem( nId, aDisplayName, MIB_CHECKABLE );
+ pVCLPopupMenu->InsertItem( nId, aDisplayName, MenuItemBits::CHECKABLE );
if ( !bFirstItemInserted )
{
bFirstItemInserted = true;
@@ -159,7 +159,7 @@ void HeaderMenuController::fillPopupMenu( const Reference< ::com::sun::star::fra
if ( bAllOneState && ( nCount > 1 ))
{
// Insert special item for all command
- pVCLPopupMenu->InsertItem( ALL_MENUITEM_ID, FwlResId(STR_MENU_HEADFOOTALL).toString(), 0, OString(), 0 );
+ pVCLPopupMenu->InsertItem( ALL_MENUITEM_ID, FwlResId(STR_MENU_HEADFOOTALL).toString(), MenuItemBits::NONE, OString(), 0 );
OUStringBuffer aStrBuf( aCmd );
aStrBuf.appendAscii( "?On:bool=" );
diff --git a/framework/source/uielement/menubarmanager.cxx b/framework/source/uielement/menubarmanager.cxx
index 705a508dd052..76f4bcdd11a0 100644
--- a/framework/source/uielement/menubarmanager.cxx
+++ b/framework/source/uielement/menubarmanager.cxx
@@ -472,8 +472,8 @@ throw ( RuntimeException, std::exception )
MenuItemBits nBits = m_pVCLMenu->GetItemBits( pMenuItemHandler->nItemId );
//If not already designated RadioButton set as CheckMark
- if (!(nBits & MIB_RADIOCHECK))
- m_pVCLMenu->SetItemBits( pMenuItemHandler->nItemId, nBits | MIB_CHECKABLE );
+ if (!(nBits & MenuItemBits::RADIOCHECK))
+ m_pVCLMenu->SetItemBits( pMenuItemHandler->nItemId, nBits | MenuItemBits::CHECKABLE );
}
else if ( Event.State >>= aItemText )
{
@@ -721,7 +721,7 @@ void MenuBarManager::CheckAndAddMenuExtension( Menu* pMenu )
if ( nBeforePos != MENU_APPEND )
nInsertPos = nBeforePos;
- pMenu->InsertItem(nNewItemId, aMenuItem.aLabel, 0, OString(), nInsertPos);
+ pMenu->InsertItem(nNewItemId, aMenuItem.aLabel, MenuItemBits::NONE, OString(), nInsertPos);
pMenu->SetItemCommand( nNewItemId, aMenuItem.aURL );
}
}
@@ -1227,7 +1227,7 @@ void MenuBarManager::FillMenuManager( Menu* pMenu, const Reference< XFrame >& rF
if (!bItemShowMenuImages)
{
MenuItemBits nBits = pMenu->GetItemBits( nItemId );
- bItemShowMenuImages = ( ( nBits & MIB_ICON ) == MIB_ICON );
+ bItemShowMenuImages = ( ( nBits & MenuItemBits::ICON ) == MenuItemBits::ICON );
}
if ( pPopup )
{
@@ -1685,11 +1685,11 @@ void MenuBarManager::FillMenu(
{
MenuItemBits nBits = pMenu->GetItemBits( nId );
if ( nStyle & ::com::sun::star::ui::ItemStyle::ICON )
- nBits |= MIB_ICON;
+ nBits |= MenuItemBits::ICON;
if ( nStyle & ::com::sun::star::ui::ItemStyle::TEXT )
- nBits |= MIB_TEXT;
+ nBits |= MenuItemBits::TEXT;
if ( nStyle & ::com::sun::star::ui::ItemStyle::RADIO_CHECK )
- nBits |= MIB_RADIOCHECK;
+ nBits |= MenuItemBits::RADIOCHECK;
pMenu->SetItemBits( nId, nBits );
}
diff --git a/framework/source/uielement/menubarmerger.cxx b/framework/source/uielement/menubarmerger.cxx
index e151ee91f767..076dcb620a0a 100644
--- a/framework/source/uielement/menubarmerger.cxx
+++ b/framework/source/uielement/menubarmerger.cxx
@@ -217,7 +217,7 @@ bool MenuBarMerger::MergeMenuItems(
}
else
{
- pMenu->InsertItem(nItemId, rMenuItem.aTitle, 0, OString(), nPos+nModIndex+nIndex);
+ pMenu->InsertItem(nItemId, rMenuItem.aTitle, MenuItemBits::NONE, OString(), nPos+nModIndex+nIndex);
pMenu->SetItemCommand( nItemId, rMenuItem.aURL );
if ( !rMenuItem.aSubMenu.empty() )
{
diff --git a/framework/source/uielement/recentfilesmenucontroller.cxx b/framework/source/uielement/recentfilesmenucontroller.cxx
index 9bbca7e71ad8..18ebbe997193 100644
--- a/framework/source/uielement/recentfilesmenucontroller.cxx
+++ b/framework/source/uielement/recentfilesmenucontroller.cxx
@@ -231,7 +231,7 @@ void RecentFilesMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu >
pVCLPopupMenu->InsertItem( 1, FWK_RESSTR(STR_NODOCUMENT) );
// Do not disable it, otherwise the Toolbar controller and MenuButton
// will display SV_RESID_STRING_NOSELECTIONPOSSIBLE instead of STR_NODOCUMENT
- pVCLPopupMenu->SetItemBits( 1, pVCLPopupMenu->GetItemBits( 1 ) | MIB_NOSELECT );
+ pVCLPopupMenu->SetItemBits( 1, pVCLPopupMenu->GetItemBits( 1 ) | MenuItemBits::NOSELECT );
}
}
}
diff --git a/framework/source/uielement/toolbarmanager.cxx b/framework/source/uielement/toolbarmanager.cxx
index bac2210de997..c211604f8afc 100644
--- a/framework/source/uielement/toolbarmanager.cxx
+++ b/framework/source/uielement/toolbarmanager.cxx
@@ -1723,7 +1723,7 @@ bool ToolBarManager::MenuItemAllowed( sal_uInt16 ) const
{
sal_uInt16 nId = m_pToolBar->GetItemId(nPos);
OUString aCommandURL = m_pToolBar->GetItemCommand( nId );
- pItemMenu->InsertItem( STARTID_CUSTOMIZE_POPUPMENU+nPos, m_pToolBar->GetItemText( nId ), MIB_CHECKABLE );
+ pItemMenu->InsertItem( STARTID_CUSTOMIZE_POPUPMENU+nPos, m_pToolBar->GetItemText( nId ), MenuItemBits::CHECKABLE );
pItemMenu->CheckItem( STARTID_CUSTOMIZE_POPUPMENU+nPos, m_pToolBar->IsItemVisible( nId ) );
pItemMenu->SetItemCommand( STARTID_CUSTOMIZE_POPUPMENU+nPos, aCommandURL );
pItemMenu->SetItemImage( STARTID_CUSTOMIZE_POPUPMENU+nPos,
diff --git a/include/rsc/rsc-vcl-shared-types.hxx b/include/rsc/rsc-vcl-shared-types.hxx
index 7c6f598b8224..005272c40efb 100644
--- a/include/rsc/rsc-vcl-shared-types.hxx
+++ b/include/rsc/rsc-vcl-shared-types.hxx
@@ -33,19 +33,24 @@ enum class KeyFuncType : sal_Int32 { DONTKNOW, NEW, OPEN, SAVE,
enum class MenuItemType { DONTKNOW, STRING, IMAGE, STRINGIMAGE, SEPARATOR };
-typedef sal_uInt16 MenuItemBits;
-
-#define MIB_CHECKABLE ((MenuItemBits)0x0001)
-#define MIB_RADIOCHECK ((MenuItemBits)0x0002)
-#define MIB_AUTOCHECK ((MenuItemBits)0x0004)
-#define MIB_ABOUT ((MenuItemBits)0x0008)
-#define MIB_HELP ((MenuItemBits)0x0010)
-#define MIB_POPUPSELECT ((MenuItemBits)0x0020)
-
-// These have been said to be a prelimitary (sic) solution since 2007
-#define MIB_NOSELECT ((MenuItemBits)0x0040)
-#define MIB_ICON ((MenuItemBits)0x0080)
-#define MIB_TEXT ((MenuItemBits)0x0100)
+enum class MenuItemBits : sal_Int16
+{
+ NONE = 0x0000,
+ CHECKABLE = 0x0001,
+ RADIOCHECK = 0x0002,
+ AUTOCHECK = 0x0004,
+ ABOUT = 0x0008,
+ HELP = 0x0010,
+ POPUPSELECT = 0x0020,
+ // These have been said to be a prelimitary (sic) solution since 2007
+ NOSELECT = 0x0040,
+ ICON = 0x0080,
+ TEXT = 0x0100,
+};
+namespace o3tl
+{
+ template<> struct typed_flags<MenuItemBits> : is_typed_flags<MenuItemBits, 0x1ff> {};
+}
enum class ToolBoxItemBits
{
diff --git a/include/svtools/toolbarmenu.hxx b/include/svtools/toolbarmenu.hxx
index 86a49dbf2b5e..5719949a1265 100644
--- a/include/svtools/toolbarmenu.hxx
+++ b/include/svtools/toolbarmenu.hxx
@@ -66,9 +66,9 @@ public:
virtual void GetFocus() SAL_OVERRIDE;
virtual void LoseFocus() SAL_OVERRIDE;
- void appendEntry( int nEntryId, const OUString& rStr, MenuItemBits nItemBits = 0 );
- void appendEntry( int nEntryId, const OUString& rStr, const Image& rImage, MenuItemBits nItemBits = 0 );
- void appendEntry( int nEntryId, Control* pControl, MenuItemBits nItemBits = 0 );
+ void appendEntry( int nEntryId, const OUString& rStr, MenuItemBits nItemBits = MenuItemBits::NONE );
+ void appendEntry( int nEntryId, const OUString& rStr, const Image& rImage, MenuItemBits nItemBits = MenuItemBits::NONE );
+ void appendEntry( int nEntryId, Control* pControl, MenuItemBits nItemBits = MenuItemBits::NONE );
void appendSeparator();
/** creates an empty ValueSet that is initialized and can be inserted with appendEntry. */
diff --git a/include/vcl/menu.hxx b/include/vcl/menu.hxx
index d6d98377a13c..207b01293926 100644
--- a/include/vcl/menu.hxx
+++ b/include/vcl/menu.hxx
@@ -220,16 +220,16 @@ public:
virtual void RequestHelp( const HelpEvent& rHEvt );
void InsertItem( sal_uInt16 nItemId, const OUString& rStr,
- MenuItemBits nItemBits = 0,
+ MenuItemBits nItemBits = MenuItemBits::NONE,
const OString &rIdent = OString(),
sal_uInt16 nPos = MENU_APPEND );
void InsertItem( sal_uInt16 nItemId, const Image& rImage,
- MenuItemBits nItemBits = 0,
+ MenuItemBits nItemBits = MenuItemBits::NONE,
const OString &rIdent = OString(),
sal_uInt16 nPos = MENU_APPEND );
void InsertItem( sal_uInt16 nItemId,
const OUString& rString, const Image& rImage,
- MenuItemBits nItemBits = 0,
+ MenuItemBits nItemBits = MenuItemBits::NONE,
const OString &rIdent = OString(),
sal_uInt16 nPos = MENU_APPEND );
void InsertItem( const ResId& rResId, sal_uInt16 nPos = MENU_APPEND );
diff --git a/rsc/inc/rscdb.hxx b/rsc/inc/rscdb.hxx
index 137c9589d764..26e0a9ba0786 100644
--- a/rsc/inc/rscdb.hxx
+++ b/rsc/inc/rscdb.hxx
@@ -41,6 +41,7 @@ enum class ToolBoxItemBits;
enum class WindowBorderStyle : sal_Int16;
enum class TimeFieldFormat : sal_Int32;
enum class KeyFuncType : sal_Int32;
+enum class MenuItemBits : sal_Int16;
struct WriteRcContext
{
@@ -150,6 +151,8 @@ class RscTypCont
inline void SETCONST( RscConst *p1, const char * p2, KeyFuncType p3 ) { SETCONST(p1, p2, static_cast<sal_uInt32>(p3)); }
inline void SETCONST( RscConst *p1, Atom p2, TimeFieldFormat p3 ) { SETCONST(p1, p2, static_cast<sal_uInt32>(p3)); }
inline void SETCONST( RscConst *p1, const char * p2, TimeFieldFormat p3 ) { SETCONST(p1, p2, static_cast<sal_uInt32>(p3)); }
+ inline void SETCONST( RscConst *p1, const char * p2, MenuItemBits p3 ) { SETCONST(p1, p2, static_cast<sal_uInt32>(p3)); }
+ inline void SETCONST( RscConst *p1, Atom p2, MenuItemBits p3 ) { SETCONST(p1, p2, static_cast<sal_uInt32>(p3)); }
RscEnum * InitLangType();
RscEnum * InitFieldUnitsType();
RscEnum * InitTimeFieldFormat();
diff --git a/rsc/source/parser/rscicpx.cxx b/rsc/source/parser/rscicpx.cxx
index 78e19d6275d7..0d2276aa7c49 100644
--- a/rsc/source/parser/rscicpx.cxx
+++ b/rsc/source/parser/rscicpx.cxx
@@ -800,15 +800,15 @@ RscTop * RscTypCont::InitClassMenuItem( RscTop * pSuper,
// Konstanten in Tabelle stellen
nCheckableId = pHS->getID( "MIB_CHECKABLE" );
- SETCONST( pFlag, nCheckableId, MIB_CHECKABLE );
+ SETCONST( pFlag, nCheckableId, MenuItemBits::CHECKABLE );
nAutoCheckId = pHS->getID( "MIB_AUTOCHECK" );
- SETCONST( pFlag, nAutoCheckId, MIB_AUTOCHECK );
+ SETCONST( pFlag, nAutoCheckId, MenuItemBits::AUTOCHECK );
nRadioCheckId = pHS->getID( "MIB_RADIOCHECK" );
- SETCONST( pFlag, nRadioCheckId, MIB_RADIOCHECK );
+ SETCONST( pFlag, nRadioCheckId, MenuItemBits::RADIOCHECK );
nAboutId = pHS->getID( "MIB_ABOUT" );
- SETCONST( pFlag, nAboutId, MIB_ABOUT );
+ SETCONST( pFlag, nAboutId, MenuItemBits::ABOUT );
nHelpId = pHS->getID( "MIB_HELP" );
- SETCONST( pFlag, nHelpId, MIB_HELP );
+ SETCONST( pFlag, nHelpId, MenuItemBits::HELP );
// Variable einfuegen
nVarId = aNmTb.Put( "_MenuItemFlags", VARNAME );
diff --git a/sc/source/ui/view/tabcont.cxx b/sc/source/ui/view/tabcont.cxx
index 2ac9d3775ff5..ff58bacf53f2 100644
--- a/sc/source/ui/view/tabcont.cxx
+++ b/sc/source/ui/view/tabcont.cxx
@@ -101,7 +101,7 @@ IMPL_LINK(ScTabControl, ShowPageList, const CommandEvent *, pEvent)
if (pDoc->GetName(i, aString))
{
sal_uInt16 nId = static_cast<sal_uInt16>(i)+1;
- aPopup.InsertItem(nId, aString, MIB_CHECKABLE);
+ aPopup.InsertItem(nId, aString, MenuItemBits::CHECKABLE);
if (nId == nCurPageId)
aPopup.CheckItem(nId);
}
diff --git a/sd/source/ui/app/sdpopup.cxx b/sd/source/ui/app/sdpopup.cxx
index 2614ba4f2b95..b9c2475205d2 100644
--- a/sd/source/ui/app/sdpopup.cxx
+++ b/sd/source/ui/app/sdpopup.cxx
@@ -50,7 +50,7 @@ SdFieldPopup::~SdFieldPopup()
void SdFieldPopup::Fill( LanguageType eLanguage )
{
sal_uInt16 nID = 1;
- sal_uInt16 nStyle = MIB_RADIOCHECK | MIB_AUTOCHECK;
+ MenuItemBits nStyle = MenuItemBits::RADIOCHECK | MenuItemBits::AUTOCHECK;
InsertItem( nID++, SD_RESSTR( STR_FIX ), nStyle );
InsertItem( nID++, SD_RESSTR( STR_VAR ), nStyle );
InsertSeparator();
diff --git a/sfx2/source/dialog/taskpane.cxx b/sfx2/source/dialog/taskpane.cxx
index be6f0ace6be2..b290c7373f6f 100644
--- a/sfx2/source/dialog/taskpane.cxx
+++ b/sfx2/source/dialog/taskpane.cxx
@@ -1205,7 +1205,7 @@ namespace sfx2
for ( size_t i=0; i<m_aPanelRepository.size(); ++i, ++nIndex )
{
const PanelDescriptor& rPanelDesc( m_aPanelRepository[i] );
- pMenu->InsertItem( nIndex, rPanelDesc.pPanel->GetDisplayName(), MIB_CHECKABLE );
+ pMenu->InsertItem( nIndex, rPanelDesc.pPanel->GetDisplayName(), MenuItemBits::CHECKABLE );
pMenu->CheckItem( nIndex, !rPanelDesc.bHidden );
}
pMenu->InsertSeparator();
@@ -1213,9 +1213,9 @@ namespace sfx2
#if OSL_DEBUG_LEVEL > 0
if (SvtMiscOptions().IsExperimentalMode())
{
- pMenu->InsertItem( MID_LAYOUT_TABS, OUString("Tab-Layout (exp.)"), MIB_CHECKABLE );
+ pMenu->InsertItem( MID_LAYOUT_TABS, OUString("Tab-Layout (exp.)"), MenuItemBits::CHECKABLE );
pMenu->CheckItem( MID_LAYOUT_TABS, impl_getLayout() != LAYOUT_DRAWERS );
- pMenu->InsertItem( MID_LAYOUT_DRAWERS, OUString("Drawer-Layout"), MIB_CHECKABLE );
+ pMenu->InsertItem( MID_LAYOUT_DRAWERS, OUString("Drawer-Layout"), MenuItemBits::CHECKABLE );
pMenu->CheckItem( MID_LAYOUT_DRAWERS, impl_getLayout() == LAYOUT_DRAWERS );
pMenu->InsertSeparator();
diff --git a/sfx2/source/menu/mnuitem.cxx b/sfx2/source/menu/mnuitem.cxx
index 3bf7e24d5ca7..c92de8a4b43d 100644
--- a/sfx2/source/menu/mnuitem.cxx
+++ b/sfx2/source/menu/mnuitem.cxx
@@ -201,7 +201,7 @@ void SfxMenuControl::StateChanged
"SfxBoolItem not allowed for SID_OBJECTMENUx" );
bCheck = static_cast<const SfxBoolItem*>(pState)->GetValue();
Menu* pMenu = pOwnMenu->GetSVMenu();
- pMenu->SetItemBits( GetId() , pMenu->GetItemBits( GetId() ) | MIB_CHECKABLE);
+ pMenu->SetItemBits( GetId() , pMenu->GetItemBits( GetId() ) | MenuItemBits::CHECKABLE);
}
else if ( pState->ISA(SfxEnumItemInterface) &&
static_cast<const SfxEnumItemInterface *>(pState)->HasBoolValue() )
@@ -211,7 +211,7 @@ void SfxMenuControl::StateChanged
"SfxEnumItem not allowed for SID_OBJECTMENUx" );
bCheck = static_cast<const SfxEnumItemInterface *>(pState)->GetBoolValue();
Menu* pMenu = pOwnMenu->GetSVMenu();
- pMenu->SetItemBits( GetId() , pMenu->GetItemBits( GetId() ) | MIB_CHECKABLE);
+ pMenu->SetItemBits( GetId() , pMenu->GetItemBits( GetId() ) | MenuItemBits::CHECKABLE);
}
else if ( ( b_ShowStrings || bIsObjMenu ) && pState->ISA(SfxStringItem) )
{
diff --git a/sfx2/source/menu/mnumgr.cxx b/sfx2/source/menu/mnumgr.cxx
index 6ff82a83a061..cbe6f09ab13b 100644
--- a/sfx2/source/menu/mnumgr.cxx
+++ b/sfx2/source/menu/mnumgr.cxx
@@ -187,7 +187,7 @@ PopupMenu* InsertThesaurusSubmenu_Impl( SfxBindings* pBindings, Menu* pSVMenu )
else // nNumSynonyms == 0
{
const OUString aItemText( SfxResId(STR_MENU_NO_SYNONYM_FOUND).toString() );
- pThesSubMenu->InsertItem( 1, aItemText, MIB_NOSELECT );
+ pThesSubMenu->InsertItem( 1, aItemText, MenuItemBits::NOSELECT );
}
pThesSubMenu->InsertSeparator();
const OUString sThesaurus( SfxResId(STR_MENU_THESAURUS).toString() );
diff --git a/sfx2/source/menu/virtmenu.cxx b/sfx2/source/menu/virtmenu.cxx
index 7be7d806fb78..2fa97069ff54 100644
--- a/sfx2/source/menu/virtmenu.cxx
+++ b/sfx2/source/menu/virtmenu.cxx
@@ -862,7 +862,7 @@ IMPL_LINK( SfxVirtualMenu, Activate, Menu *, pMenu )
nItemId = START_ITEMID_WINDOWLIST;
for ( sal_uInt32 i = 0; i < aNewWindowListVector.size(); i++ )
{
- pMenu->InsertItem( nItemId, aNewWindowListVector.at( i ), MIB_RADIOCHECK );
+ pMenu->InsertItem( nItemId, aNewWindowListVector.at( i ), MenuItemBits::RADIOCHECK );
if ( nItemId == nActiveItemId )
pMenu->CheckItem( nItemId );
++nItemId;
diff --git a/sfx2/source/sidebar/SidebarController.cxx b/sfx2/source/sidebar/SidebarController.cxx
index d8668186fcf3..6b6bd0d11aa0 100644
--- a/sfx2/source/sidebar/SidebarController.cxx
+++ b/sfx2/source/sidebar/SidebarController.cxx
@@ -888,7 +888,7 @@ void SidebarController::ShowPopupMenu (
++iItem,++nIndex)
{
const sal_Int32 nMenuIndex (nIndex+MID_FIRST_PANEL);
- pMenu->InsertItem(nMenuIndex, iItem->msDisplayName, MIB_RADIOCHECK);
+ pMenu->InsertItem(nMenuIndex, iItem->msDisplayName, MenuItemBits::RADIOCHECK);
pMenu->CheckItem(nMenuIndex, iItem->mbIsCurrentDeck ? sal_True : sal_False);
pMenu->EnableItem(nMenuIndex, (iItem->mbIsEnabled&&iItem->mbIsActive) ? sal_True : sal_False);
@@ -896,12 +896,12 @@ void SidebarController::ShowPopupMenu (
if (iItem->mbIsCurrentDeck)
{
// Don't allow the currently visible deck to be disabled.
- pCustomizationMenu->InsertItem(nSubMenuIndex, iItem->msDisplayName, MIB_RADIOCHECK);
+ pCustomizationMenu->InsertItem(nSubMenuIndex, iItem->msDisplayName, MenuItemBits::RADIOCHECK);
pCustomizationMenu->CheckItem(nSubMenuIndex, true);
}
else
{
- pCustomizationMenu->InsertItem(nSubMenuIndex, iItem->msDisplayName, MIB_CHECKABLE);
+ pCustomizationMenu->InsertItem(nSubMenuIndex, iItem->msDisplayName, MenuItemBits::CHECKABLE);
pCustomizationMenu->CheckItem(nSubMenuIndex, iItem->mbIsActive ? sal_True : sal_False);
}
}
@@ -962,7 +962,7 @@ IMPL_LINK(SidebarController, OnMenuItemSelected, Menu*, pMenu)
SwitchToDeck(mpTabBar->GetDeckIdForIndex(nIndex - MID_FIRST_PANEL));
}
else if (nIndex >=MID_FIRST_HIDE)
- if (pMenu->GetItemBits(nIndex) == MIB_CHECKABLE)
+ if (pMenu->GetItemBits(nIndex) == MenuItemBits::CHECKABLE)
mpTabBar->ToggleHideFlag(nIndex-MID_FIRST_HIDE);
}
catch (RuntimeException&)
diff --git a/svtools/source/control/stdmenu.cxx b/svtools/source/control/stdmenu.cxx
index b0b3eba9479e..4a91286115a8 100644
--- a/svtools/source/control/stdmenu.cxx
+++ b/svtools/source/control/stdmenu.cxx
@@ -72,7 +72,7 @@ void FontNameMenu::Fill( const FontList* pList )
break;
j--;
}
- InsertItem( i+1, rName, MIB_RADIOCHECK | MIB_AUTOCHECK, OString(), j );
+ InsertItem( i+1, rName, MenuItemBits::RADIOCHECK | MenuItemBits::AUTOCHECK, OString(), j );
}
}
@@ -171,7 +171,7 @@ void FontSizeMenu::Fill( const vcl::FontInfo& rInfo, const FontList* pList )
long nSize = aFontSizeNames.GetIndexSize( i );
mpHeightAry[nPos] = nSize;
nPos++; // Id is nPos+1
- InsertItem( nPos, aSizeName, MIB_RADIOCHECK | MIB_AUTOCHECK );
+ InsertItem( nPos, aSizeName, MenuItemBits::RADIOCHECK | MenuItemBits::AUTOCHECK );
}
}
else
@@ -185,7 +185,7 @@ void FontSizeMenu::Fill( const vcl::FontInfo& rInfo, const FontList* pList )
{
mpHeightAry[nPos] = *pTempAry;
nPos++; // Id is nPos+1
- InsertItem( nPos, aSizeName, MIB_RADIOCHECK | MIB_AUTOCHECK );
+ InsertItem( nPos, aSizeName, MenuItemBits::RADIOCHECK | MenuItemBits::AUTOCHECK );
}
pTempAry++;
}
@@ -199,7 +199,7 @@ void FontSizeMenu::Fill( const vcl::FontInfo& rInfo, const FontList* pList )
{
mpHeightAry[nPos] = *pTempAry;
nPos++; // Id is nPos+1
- InsertItem( nPos, rI18nHelper.GetNum( *pTempAry, 1, true, false ), MIB_RADIOCHECK | MIB_AUTOCHECK );
+ InsertItem( nPos, rI18nHelper.GetNum( *pTempAry, 1, true, false ), MenuItemBits::RADIOCHECK | MenuItemBits::AUTOCHECK );
pTempAry++;
}
diff --git a/svtools/source/control/toolbarmenu.cxx b/svtools/source/control/toolbarmenu.cxx
index 6e9daefb22b1..d5cb6fbe97fa 100644
--- a/svtools/source/control/toolbarmenu.cxx
+++ b/svtools/source/control/toolbarmenu.cxx
@@ -698,20 +698,20 @@ Size ToolbarMenu::implCalcSize()
if( pEntry->HasCheck() && !pEntry->mbHasImage )
{
if( this->IsNativeControlSupported( CTRL_MENU_POPUP,
- (pEntry->mnBits & MIB_RADIOCHECK)
+ (pEntry->mnBits & MenuItemBits::RADIOCHECK)
? PART_MENU_ITEM_CHECK_MARK
: PART_MENU_ITEM_RADIO_MARK ) )
{
long nCheckHeight = 0, nRadioHeight = 0, nMaxCheckWidth = 0;
ImplGetNativeCheckAndRadioSize( this, nCheckHeight, nRadioHeight, nMaxCheckWidth );
- long nCtrlHeight = (pEntry->mnBits & MIB_RADIOCHECK) ? nCheckHeight : nRadioHeight;
+ long nCtrlHeight = (pEntry->mnBits & MenuItemBits::RADIOCHECK) ? nCheckHeight : nRadioHeight;
nMaxTextWidth += nCtrlHeight + gfxExtra;
}
else if( pEntry->mbChecked )
{
long nSymbolWidth = (nFontHeight*25)/40;
- if ( pEntry->mnBits & MIB_RADIOCHECK )
+ if ( pEntry->mnBits & MenuItemBits::RADIOCHECK )
nSymbolWidth = nFontHeight/2;
nMaxTextWidth += nSymbolWidth;
@@ -894,7 +894,7 @@ void ToolbarMenu::implHighlightEntry( int nHighlightEntry, bool bHighlight )
bool bDrawItemRect = true;
Rectangle aItemRect( Point( nX, nY ), Size( aSz.Width(), pEntry->maSize.Height() ) );
- if ( pEntry->mnBits & MIB_POPUPSELECT )
+ if ( pEntry->mnBits & MenuItemBits::POPUPSELECT )
{
long nFontHeight = GetTextHeight();
aItemRect.Right() -= nFontHeight + nFontHeight/4;
@@ -1400,11 +1400,11 @@ void ToolbarMenu::implPaint( ToolbarMenuEntry* pThisOnly, bool bHighlighted )
if( !pEntry->mbHasImage )
{
if( this->IsNativeControlSupported( CTRL_MENU_POPUP,
- (pEntry->mnBits & MIB_RADIOCHECK)
+ (pEntry->mnBits & MenuItemBits::RADIOCHECK)
? PART_MENU_ITEM_CHECK_MARK
: PART_MENU_ITEM_RADIO_MARK ) )
{
- ControlPart nPart = ((pEntry->mnBits & MIB_RADIOCHECK)
+ ControlPart nPart = ((pEntry->mnBits & MenuItemBits::RADIOCHECK)
? PART_MENU_ITEM_RADIO_MARK
: PART_MENU_ITEM_CHECK_MARK);
@@ -1419,7 +1419,7 @@ void ToolbarMenu::implPaint( ToolbarMenuEntry* pThisOnly, bool bHighlighted )
if ( bHighlighted )
nState |= CTRL_STATE_SELECTED;
- long nCtrlHeight = (pEntry->mnBits & MIB_RADIOCHECK) ? nCheckHeight : nRadioHeight;
+ long nCtrlHeight = (pEntry->mnBits & MenuItemBits::RADIOCHECK) ? nCheckHeight : nRadioHeight;
aTmpPos.X() = aOuterCheckRect.Left() + (aOuterCheckRect.GetWidth() - nCtrlHeight)/2;
aTmpPos.Y() = aOuterCheckRect.Top() + (aOuterCheckRect.GetHeight() - nCtrlHeight)/2;
@@ -1433,7 +1433,7 @@ void ToolbarMenu::implPaint( ToolbarMenuEntry* pThisOnly, bool bHighlighted )
SymbolType eSymbol;
Size aSymbolSize;
- if ( pEntry->mnBits & MIB_RADIOCHECK )
+ if ( pEntry->mnBits & MenuItemBits::RADIOCHECK )
{
eSymbol = SymbolType::RADIOCHECKMARK;
aSymbolSize = Size( nFontHeight/2, nFontHeight/2 );
diff --git a/svtools/source/control/toolbarmenuimp.hxx b/svtools/source/control/toolbarmenuimp.hxx
index 793af00098ec..9a32d694fff4 100644
--- a/svtools/source/control/toolbarmenuimp.hxx
+++ b/svtools/source/control/toolbarmenuimp.hxx
@@ -97,7 +97,7 @@ public:
bool HasCheck() const
{
- return mbChecked || ( mnBits & ( MIB_RADIOCHECK | MIB_CHECKABLE | MIB_AUTOCHECK ) );
+ return mbChecked || ( mnBits & ( MenuItemBits::RADIOCHECK | MenuItemBits::CHECKABLE | MenuItemBits::AUTOCHECK ) );
}
};
diff --git a/svx/source/fmcomp/fmgridcl.cxx b/svx/source/fmcomp/fmgridcl.cxx
index 13860381ab04..c49be04290ee 100644
--- a/svx/source/fmcomp/fmgridcl.cxx
+++ b/svx/source/fmcomp/fmgridcl.cxx
@@ -729,7 +729,7 @@ void FmGridHeader::PreExecuteColumnContextMenu(sal_uInt16 nColId, PopupMenu& rMe
{ // (only the first 16 items to keep the menu rather small)
aName = xCurCol->getPropertyValue(FM_PROP_LABEL);
pShowColsMenu->InsertItem(nHiddenCols + 1, ::comphelper::getString(aName),
- 0, OString(), nHiddenCols);
+ MenuItemBits::NONE, OString(), nHiddenCols);
// the ID is arbitrary, but should be unique within the whole menu
}
++nHiddenCols;
diff --git a/svx/source/form/datanavi.cxx b/svx/source/form/datanavi.cxx
index 2a0baed9638f..461c11d1cf24 100644
--- a/svx/source/form/datanavi.cxx
+++ b/svx/source/form/datanavi.cxx
@@ -1384,7 +1384,7 @@ namespace svxform
Menu* pMenu = m_pInstanceBtn->GetPopupMenu();
sal_uInt16 nInstancesDetailsId = pMenu->GetItemId("instancesdetails");
- pMenu->SetItemBits(nInstancesDetailsId, MIB_CHECKABLE );
+ pMenu->SetItemBits(nInstancesDetailsId, MenuItemBits::CHECKABLE );
pMenu->CheckItem(nInstancesDetailsId, m_bShowDetails );
m_pTabCtrl->SetCurPageId( static_cast< sal_uInt16 >( nPageId ) );
diff --git a/svx/source/mnuctrls/SmartTagCtl.cxx b/svx/source/mnuctrls/SmartTagCtl.cxx
index 6ffe39543d59..be1f7483726d 100644
--- a/svx/source/mnuctrls/SmartTagCtl.cxx
+++ b/svx/source/mnuctrls/SmartTagCtl.cxx
@@ -96,7 +96,7 @@ void SvxSmartTagsControl::FillMenu()
PopupMenu* pSbMenu = mpMenu;
if ( 1 < rActionComponentsSequence.getLength() )
{
- mpMenu->InsertItem(nMenuId, aSmartTagCaption, 0, OString(), nMenuPos++);
+ mpMenu->InsertItem(nMenuId, aSmartTagCaption, MenuItemBits::NONE, OString(), nMenuPos++);
pSbMenu = new PopupMenu;
mpMenu->SetPopupMenu( nMenuId++, pSbMenu );
}
@@ -105,7 +105,7 @@ void SvxSmartTagsControl::FillMenu()
// sub-menu starts with smart tag caption and separator
const OUString aSmartTagCaption2 = aSmartTagCaption + ": " + aRangeText;
nSubMenuPos = 0;
- pSbMenu->InsertItem(nMenuId++, aSmartTagCaption2, MIB_NOSELECT, OString(), nSubMenuPos++);
+ pSbMenu->InsertItem(nMenuId++, aSmartTagCaption2, MenuItemBits::NOSELECT, OString(), nSubMenuPos++);
pSbMenu->InsertSeparator(OString(), nSubMenuPos++);
// Add subitem for every action reference for the current smart tag type:
@@ -125,7 +125,7 @@ void SvxSmartTagsControl::FillMenu()
xController,
xTextRange );
- pSbMenu->InsertItem( nSubMenuId++, aActionCaption, 0, OString(), nSubMenuPos++ );
+ pSbMenu->InsertItem( nSubMenuId++, aActionCaption, MenuItemBits::NONE, OString(), nSubMenuPos++ );
InvokeAction aEntry( xAction, xSmartTagProperties, nActionID );
maInvokeActions.push_back( aEntry );
}
diff --git a/svx/source/tbxctrls/fontworkgallery.cxx b/svx/source/tbxctrls/fontworkgallery.cxx
index 530b1614024a..c433963cffe0 100644
--- a/svx/source/tbxctrls/fontworkgallery.cxx
+++ b/svx/source/tbxctrls/fontworkgallery.cxx
@@ -510,14 +510,14 @@ FontworkCharacterSpacingWindow::FontworkCharacterSpacingWindow( svt::ToolboxCont
SetHelpId( HID_POPUP_FONTWORK_CHARSPACE );
SetSelectHdl( LINK( this, FontworkCharacterSpacingWindow, SelectHdl ) );
- appendEntry( 0, SVX_RESSTR( STR_CHARS_SPACING_VERY_TIGHT ), MIB_RADIOCHECK );
- appendEntry( 1, SVX_RESSTR( STR_CHARS_SPACING_TIGHT ), MIB_RADIOCHECK );
- appendEntry( 2, SVX_RESSTR( STR_CHARS_SPACING_NORMAL ), MIB_RADIOCHECK );
- appendEntry( 3, SVX_RESSTR( STR_CHARS_SPACING_LOOSE ), MIB_RADIOCHECK );
- appendEntry( 4, SVX_RESSTR( STR_CHARS_SPACING_VERY_LOOSE ), MIB_RADIOCHECK );
- appendEntry( 5, SVX_RESSTR( STR_CHARS_SPACING_CUSTOM ), MIB_RADIOCHECK );
+ appendEntry( 0, SVX_RESSTR( STR_CHARS_SPACING_VERY_TIGHT ), MenuItemBits::RADIOCHECK );
+ appendEntry( 1, SVX_RESSTR( STR_CHARS_SPACING_TIGHT ), MenuItemBits::RADIOCHECK );
+ appendEntry( 2, SVX_RESSTR( STR_CHARS_SPACING_NORMAL ), MenuItemBits::RADIOCHECK );
+ appendEntry( 3, SVX_RESSTR( STR_CHARS_SPACING_LOOSE ), MenuItemBits::RADIOCHECK );
+ appendEntry( 4, SVX_RESSTR( STR_CHARS_SPACING_VERY_LOOSE ), MenuItemBits::RADIOCHECK );
+ appendEntry( 5, SVX_RESSTR( STR_CHARS_SPACING_CUSTOM ), MenuItemBits::RADIOCHECK );
appendSeparator();
- appendEntry( 6, SVX_RESSTR( STR_CHARS_SPACING_KERN_PAIRS ), MIB_CHECKABLE );
+ appendEntry( 6, SVX_RESSTR( STR_CHARS_SPACING_KERN_PAIRS ), MenuItemBits::CHECKABLE );
SetOutputSizePixel( getMenuSize() );
diff --git a/sw/source/uibase/lingu/olmenu.cxx b/sw/source/uibase/lingu/olmenu.cxx
index 2c1b0bb53b33..50f6925cbc6a 100644
--- a/sw/source/uibase/lingu/olmenu.cxx
+++ b/sw/source/uibase/lingu/olmenu.cxx
@@ -203,7 +203,7 @@ void SwSpellPopup::fillLangPopupMenu(
{
OSL_ENSURE( nLangItemIdStart <= nItemId && nItemId <= nLangItemIdStart + MN_MAX_NUM_LANG,
"nItemId outside of expected range!" );
- pPopupMenu->InsertItem( nItemId, aEntryTxt, MIB_RADIOCHECK );
+ pPopupMenu->InsertItem( nItemId, aEntryTxt, MenuItemBits::RADIOCHECK );
if (aEntryTxt == aCurLang)
{
//make a check mark for the current language
@@ -214,12 +214,12 @@ void SwSpellPopup::fillLangPopupMenu(
}
}
- pPopupMenu->InsertItem( nLangItemIdStart + MN_NONE_OFFSET, OUString(SW_RES( STR_LANGSTATUS_NONE )), MIB_RADIOCHECK );
+ pPopupMenu->InsertItem( nLangItemIdStart + MN_NONE_OFFSET, OUString(SW_RES( STR_LANGSTATUS_NONE )), MenuItemBits::RADIOCHECK );
if ( SvtLanguageTable::GetLanguageString( LANGUAGE_NONE ) == aCurLang )
pPopupMenu->CheckItem( nLangItemIdStart + MN_NONE_OFFSET, true );
- pPopupMenu->InsertItem( nLangItemIdStart + MN_RESET_OFFSET, OUString(SW_RES( STR_RESET_TO_DEFAULT_LANGUAGE )), 0 );
- pPopupMenu->InsertItem( nLangItemIdStart + MN_MORE_OFFSET, OUString(SW_RES( STR_LANGSTATUS_MORE )), 0 );
+ pPopupMenu->InsertItem( nLangItemIdStart + MN_RESET_OFFSET, OUString(SW_RES( STR_RESET_TO_DEFAULT_LANGUAGE )), MenuItemBits::NONE );
+ pPopupMenu->InsertItem( nLangItemIdStart + MN_MORE_OFFSET, OUString(SW_RES( STR_LANGSTATUS_MORE )), MenuItemBits::NONE );
}
OUString RetrieveLabelFromCommand( const OUString& aCmdURL )
@@ -310,7 +310,7 @@ SwSpellPopup::SwSpellPopup(
for (sal_uInt16 i = 0; i < nStringCount; ++i)
{
const OUString aEntry = m_aSuggestions[ i ];
- InsertItem(nItemId, aEntry, 0, OString(), i);
+ InsertItem(nItemId, aEntry, MenuItemBits::NONE, OString(), i);
SetHelpId( nItemId, HID_LINGU_REPLACE);
if (!aSuggestionImageUrl.isEmpty())
SetItemImage( nItemId, aImage );
@@ -327,7 +327,7 @@ SwSpellPopup::SwSpellPopup(
OUString aSpellingAndGrammar = RetrieveLabelFromCommand( ".uno:SpellingAndGrammarDialog" );
SetItemText( MN_SPELLING_DLG, aSpellingAndGrammar );
sal_uInt16 nItemPos = GetItemPos( MN_IGNORE_WORD );
- InsertItem(MN_IGNORE_SELECTION, aIgnoreSelection, 0, OString(), nItemPos);
+ InsertItem(MN_IGNORE_SELECTION, aIgnoreSelection, MenuItemBits::NONE, OString(), nItemPos);
SetHelpId( MN_IGNORE_SELECTION, HID_LINGU_IGNORE_SELECTION);
EnableItem( MN_AUTOCORR, bEnable );
@@ -470,7 +470,7 @@ m_aInfo16( SW_RES(IMG_INFO_16) )
sal_uInt16 nPos = 0;
OUString aMessageText( rResult.aErrors[ nErrorInResult ].aShortComment );
InsertSeparator(OString(), nPos++);
- InsertItem(MN_SHORT_COMMENT, aMessageText, MIB_NOSELECT, OString(), nPos++);
+ InsertItem(MN_SHORT_COMMENT, aMessageText, MenuItemBits::NOSELECT, OString(), nPos++);
if (bUseImagesInMenus)
SetItemImage( MN_SHORT_COMMENT, m_aInfo16 );
@@ -491,7 +491,7 @@ m_aInfo16( SW_RES(IMG_INFO_16) )
if ( !m_sExplanationLink.isEmpty( ) )
{
- InsertItem(MN_EXPLANATION_LINK, SW_RESSTR(STR_EXPLANATION_LINK), MIB_TEXT | MIB_HELP, OString(), nPos++);
+ InsertItem(MN_EXPLANATION_LINK, SW_RESSTR(STR_EXPLANATION_LINK), MenuItemBits::TEXT | MenuItemBits::HELP, OString(), nPos++);
}
SetMenuFlags(MENU_FLAG_NOAUTOMNEMONICS);
@@ -517,7 +517,7 @@ m_aInfo16( SW_RES(IMG_INFO_16) )
for (sal_uInt16 i = 0; i < nStringCount; ++i)
{
const OUString aEntry = m_aSuggestions[ i ];
- InsertItem(nItemId, aEntry, 0, OString(), nPos++);
+ InsertItem(nItemId, aEntry, MenuItemBits::NONE, OString(), nPos++);
SetHelpId( nItemId, HID_LINGU_REPLACE );
if (!aSuggestionImageUrl.isEmpty())
SetItemImage( nItemId, aImage );
@@ -531,7 +531,7 @@ m_aInfo16( SW_RES(IMG_INFO_16) )
OUString aSpellingAndGrammar = RetrieveLabelFromCommand( ".uno:SpellingAndGrammarDialog" );
SetItemText( MN_SPELLING_DLG, aSpellingAndGrammar );
sal_uInt16 nItemPos = GetItemPos( MN_IGNORE_WORD );
- InsertItem( MN_IGNORE_SELECTION, aIgnoreSelection, 0, OString(), nItemPos );
+ InsertItem( MN_IGNORE_SELECTION, aIgnoreSelection, MenuItemBits::NONE, OString(), nItemPos );
SetHelpId( MN_IGNORE_SELECTION, HID_LINGU_IGNORE_SELECTION);
EnableItem( MN_AUTOCORR, false );
diff --git a/sw/source/uibase/smartmenu/stmenu.cxx b/sw/source/uibase/smartmenu/stmenu.cxx
index aff345e6ec42..42751cfc507d 100644
--- a/sw/source/uibase/smartmenu/stmenu.cxx
+++ b/sw/source/uibase/smartmenu/stmenu.cxx
@@ -85,7 +85,7 @@ SwSmartTagPopup::SwSmartTagPopup( SwView* pSwView,
PopupMenu* pSbMenu = this;
if ( 1 < aActionComponentsSequence.getLength() )
{
- InsertItem(nMenuId, aSmartTagCaption, 0, OString(), nMenuPos++);
+ InsertItem(nMenuId, aSmartTagCaption, MenuItemBits::NONE, OString(), nMenuPos++);
pSbMenu = new PopupMenu;
SetPopupMenu( nMenuId++, pSbMenu );
}
@@ -93,7 +93,7 @@ SwSmartTagPopup::SwSmartTagPopup( SwView* pSwView,
// sub-menu starts with smart tag caption and separator
const OUString aSmartTagCaption2 = aSmartTagCaption + ": " + aRangeText;
sal_uInt16 nSubMenuPos = 0;
- pSbMenu->InsertItem(nMenuId++, aSmartTagCaption2, MIB_NOSELECT, OString(), nSubMenuPos++);
+ pSbMenu->InsertItem(nMenuId++, aSmartTagCaption2, MenuItemBits::NOSELECT, OString(), nSubMenuPos++);
pSbMenu->InsertSeparator(OString(), nSubMenuPos++);
// Add subitem for every action reference for the current smart tag type:
@@ -113,7 +113,7 @@ SwSmartTagPopup::SwSmartTagPopup( SwView* pSwView,
xController,
mxTextRange );
- pSbMenu->InsertItem(nSubMenuId++, aActionCaption, 0, OString(), nSubMenuPos++);
+ pSbMenu->InsertItem(nSubMenuId++, aActionCaption, MenuItemBits::NONE, OString(), nSubMenuPos++);
InvokeAction aEntry( xAction, xSmartTagProperties, nActionID );
maInvokeActions.push_back( aEntry );
}
diff --git a/vcl/source/control/tabctrl.cxx b/vcl/source/control/tabctrl.cxx
index b28b4ca030b3..8c58442ba063 100644
--- a/vcl/source/control/tabctrl.cxx
+++ b/vcl/source/control/tabctrl.cxx
@@ -1448,7 +1448,7 @@ void TabControl::Command( const CommandEvent& rCEvt )
for( std::vector< ImplTabItem >::iterator it = mpTabCtrlData->maItemList.begin();
it != mpTabCtrlData->maItemList.end(); ++it )
{
- aMenu.InsertItem( it->mnId, it->maText, MIB_CHECKABLE );
+ aMenu.InsertItem( it->mnId, it->maText, MenuItemBits::CHECKABLE );
if ( it->mnId == mnCurPageId )
aMenu.CheckItem( it->mnId );
aMenu.SetHelpId( it->mnId, it->maHelpId );
diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx
index f8fad60ec7c9..68f5c9dc5181 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -2711,7 +2711,7 @@ void VclBuilder::insertMenuObject(PopupMenu *pParent, const OString &rClass, con
if (rClass == "GtkMenuItem")
{
OUString sLabel(OStringToOUString(convertMnemonicMarkup(extractLabel(rProps)), RTL_TEXTENCODING_UTF8));
- pParent->InsertItem(nNewId, sLabel, MIB_TEXT, rID);
+ pParent->InsertItem(nNewId, sLabel, MenuItemBits::TEXT, rID);
}
else if (rClass == "GtkSeparatorMenuItem")
{
diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx
index 5ec2aa4d7418..c65930cc655f 100644
--- a/vcl/source/window/menu.cxx
+++ b/vcl/source/window/menu.cxx
@@ -184,13 +184,13 @@ void Menu::CreateAutoMnemonics()
for ( n = 0; n < pItemList->size(); n++ )
{
MenuItemData* pData = pItemList->GetDataFromPos( n );
- if ( ! (pData->nBits & MIB_NOSELECT ) )
+ if ( ! (pData->nBits & MenuItemBits::NOSELECT ) )
aMnemonicGenerator.RegisterMnemonic( pData->aText );
}
for ( n = 0; n < pItemList->size(); n++ )
{
MenuItemData* pData = pItemList->GetDataFromPos( n );
- if ( ! (pData->nBits & MIB_NOSELECT ) )
+ if ( ! (pData->nBits & MenuItemBits::NOSELECT ) )
pData->aText = aMnemonicGenerator.CreateMnemonic( pData->aText );
}
}
@@ -276,10 +276,10 @@ void Menu::Highlight()
void Menu::ImplSelect()
{
MenuItemData* pData = GetItemList()->GetData( nSelectedId );
- if ( pData && (pData->nBits & MIB_AUTOCHECK) )
+ if ( pData && (pData->nBits & MenuItemBits::AUTOCHECK) )
{
bool bChecked = IsItemChecked( nSelectedId );
- if ( pData->nBits & MIB_RADIOCHECK )
+ if ( pData->nBits & MenuItemBits::RADIOCHECK )
{
if ( !bChecked )
CheckItem( nSelectedId, true );
@@ -434,7 +434,7 @@ void Menu::InsertItem( const ResId& rResId, sal_uInt16 nPos )
if ( nObjMask & RSC_MENUITEM_ID )
nItemId = sal::static_int_cast<sal_uInt16>(ReadLongRes());
- MenuItemBits nStatus = 0;
+ MenuItemBits nStatus = MenuItemBits::NONE;
if ( nObjMask & RSC_MENUITEM_STATUS )
nStatus = sal::static_int_cast<MenuItemBits>(ReadLongRes());
@@ -745,7 +745,7 @@ void Menu::SetItemBits( sal_uInt16 nItemId, MenuItemBits nBits )
MenuItemBits Menu::GetItemBits( sal_uInt16 nItemId ) const
{
- MenuItemBits nBits = 0;
+ MenuItemBits nBits = MenuItemBits::NONE;
MenuItemData* pData = pItemList->GetData( nItemId );
if ( pData )
nBits = pData->nBits;
@@ -869,8 +869,8 @@ void Menu::CheckItem( sal_uInt16 nItemId, bool bCheck )
return;
// if radio-check, then uncheck previous
- if ( bCheck && (pData->nBits & MIB_AUTOCHECK) &&
- (pData->nBits & MIB_RADIOCHECK) )
+ if ( bCheck && (pData->nBits & MenuItemBits::AUTOCHECK) &&
+ (pData->nBits & MenuItemBits::RADIOCHECK) )
{
MenuItemData* pGroupData;
sal_uInt16 nGroupPos;
@@ -881,7 +881,7 @@ void Menu::CheckItem( sal_uInt16 nItemId, bool bCheck )
while ( nGroupPos )
{
pGroupData = pItemList->GetDataFromPos( nGroupPos-1 );
- if ( pGroupData->nBits & MIB_RADIOCHECK )
+ if ( pGroupData->nBits & MenuItemBits::RADIOCHECK )
{
if ( IsItemChecked( pGroupData->nId ) )
{
@@ -901,7 +901,7 @@ void Menu::CheckItem( sal_uInt16 nItemId, bool bCheck )
while ( nGroupPos < nItemCount )
{
pGroupData = pItemList->GetDataFromPos( nGroupPos );
- if ( pGroupData->nBits & MIB_RADIOCHECK )
+ if ( pGroupData->nBits & MenuItemBits::RADIOCHECK )
{
if ( IsItemChecked( pGroupData->nId ) )
{
@@ -1342,7 +1342,7 @@ bool Menu::ImplIsSelectable( sal_uInt16 nPos ) const
MenuItemData* pData = pItemList->GetDataFromPos( nPos );
// check general visibility first
- if ( pData && ( pData->nBits & MIB_NOSELECT ) )
+ if ( pData && ( pData->nBits & MenuItemBits::NOSELECT ) )
bSelectable = false;
return bSelectable;
@@ -1863,11 +1863,11 @@ void Menu::ImplPaint( vcl::Window* pWin, sal_uInt16 nBorder, long nStartY, MenuI
if( ! ( ( pData->eType == MenuItemType::IMAGE ) || ( pData->eType == MenuItemType::STRINGIMAGE ) ) )
{
if ( pWin->IsNativeControlSupported( CTRL_MENU_POPUP,
- (pData->nBits & MIB_RADIOCHECK)
+ (pData->nBits & MenuItemBits::RADIOCHECK)
? PART_MENU_ITEM_CHECK_MARK
: PART_MENU_ITEM_RADIO_MARK ) )
{
- ControlPart nPart = ((pData->nBits & MIB_RADIOCHECK)
+ ControlPart nPart = ((pData->nBits & MenuItemBits::RADIOCHECK)
? PART_MENU_ITEM_RADIO_MARK
: PART_MENU_ITEM_CHECK_MARK);
@@ -1882,7 +1882,7 @@ void Menu::ImplPaint( vcl::Window* pWin, sal_uInt16 nBorder, long nStartY, MenuI
if ( bHighlighted )
nState |= CTRL_STATE_SELECTED;
- long nCtrlHeight = (pData->nBits & MIB_RADIOCHECK) ? nCheckHeight : nRadioHeight;
+ long nCtrlHeight = (pData->nBits & MenuItemBits::RADIOCHECK) ? nCheckHeight : nRadioHeight;
aTmpPos.X() = aOuterCheckRect.Left() + (aOuterCheckRect.GetWidth() - nCtrlHeight)/2;
aTmpPos.Y() = aOuterCheckRect.Top() + (aOuterCheckRect.GetHeight() - nCtrlHeight)/2;
@@ -1903,7 +1903,7 @@ void Menu::ImplPaint( vcl::Window* pWin, sal_uInt16 nBorder, long nStartY, MenuI
SymbolType eSymbol;
Size aSymbolSize;
- if ( pData->nBits & MIB_RADIOCHECK )
+ if ( pData->nBits & MenuItemBits::RADIOCHECK )
{
eSymbol = SymbolType::RADIOCHECKMARK;
aSymbolSize = Size( nFontHeight/2, nFontHeight/2 );
@@ -2035,7 +2035,7 @@ void Menu::ImplPaint( vcl::Window* pWin, sal_uInt16 nBorder, long nStartY, MenuI
aTmpPos.Y() = aPos.Y();
aTmpPos.Y() += nExtra/2;
aTmpPos.Y() += ( pData->aSz.Height() / 2 ) - ( nFontHeight/4 );
- if ( pData->nBits & MIB_POPUPSELECT )
+ if ( pData->nBits & MenuItemBits::POPUPSELECT )
{
pWin->SetTextColor( rSettings.GetMenuTextColor() );
Point aTmpPos2( aPos );
@@ -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, MenuItemType::STRING, 0, aTmpEntryText, Image(), NULL, 0xFFFF, OString() );
+ 0xFFFF, MenuItemType::STRING, MenuItemBits::NONE, aTmpEntryText, Image(), NULL, 0xFFFF, OString() );
size_t nPos = 0;
pData = pItemList->GetData( pData->nId, nPos );
assert(pData);
diff --git a/vcl/source/window/menufloatingwindow.cxx b/vcl/source/window/menufloatingwindow.cxx
index 5b0ed083d23e..c83eddebf577 100644
--- a/vcl/source/window/menufloatingwindow.cxx
+++ b/vcl/source/window/menufloatingwindow.cxx
@@ -177,7 +177,7 @@ void MenuFloatingWindow::ImplHighlightItem( const MouseEvent& rMEvt, bool bMBDow
if ( ( nOldY <= nMouseY ) && ( nY > nMouseY ) && pMenu->ImplIsSelectable( n ) )
{
bool bPopupArea = true;
- if ( pItemData->nBits & MIB_POPUPSELECT )
+ if ( pItemData->nBits & MenuItemBits::POPUPSELECT )
{
// only when clicked over the arrow...
Size aSz = GetOutputSizePixel();
@@ -212,7 +212,7 @@ void MenuFloatingWindow::ImplHighlightItem( const MouseEvent& rMEvt, bool bMBDow
{
ChangeHighlightItem( (sal_uInt16)n, true );
}
- else if ( pItemData->nBits & MIB_POPUPSELECT )
+ else if ( pItemData->nBits & MenuItemBits::POPUPSELECT )
{
if ( bPopupArea && ( pActivePopup != pItemData->pSubMenu ) )
HighlightChanged( NULL );
@@ -507,7 +507,7 @@ void MenuFloatingWindow::MouseButtonUp( const MouseEvent& rMEvt )
{
EndExecute();
}
- else if ( ( pData->nBits & MIB_POPUPSELECT ) && ( nHighlightedItem == _nMBDownPos ) && ( rMEvt.GetClicks() == 2 ) )
+ else if ( ( pData->nBits & MenuItemBits::POPUPSELECT ) && ( nHighlightedItem == _nMBDownPos ) && ( rMEvt.GetClicks() == 2 ) )
{
// not when clicked over the arrow...
Size aSz = GetOutputSizePixel();
@@ -738,7 +738,7 @@ void MenuFloatingWindow::HighlightItem( sal_uInt16 nPos, bool bHighlight )
bool bDrawItemRect = true;
Rectangle aItemRect( Point( nX+nOuterSpaceX, nY ), Size( aSz.Width()-2*nOuterSpaceX, pData->aSz.Height() ) );
- if ( pData->nBits & MIB_POPUPSELECT )
+ if ( pData->nBits & MenuItemBits::POPUPSELECT )
{
long nFontHeight = GetTextHeight();
aItemRect.Right() -= nFontHeight + nFontHeight/4;
@@ -827,7 +827,7 @@ Rectangle MenuFloatingWindow::ImplGetItemRect( sal_uInt16 nPos )
if ( pData->eType != MenuItemType::SEPARATOR )
{
aRect = Rectangle( Point( nX, nY ), Size( aSz.Width(), pData->aSz.Height() ) );
- if ( pData->nBits & MIB_POPUPSELECT )
+ if ( pData->nBits & MenuItemBits::POPUPSELECT )
{
long nFontHeight = GetTextHeight();
aRect.Right() -= nFontHeight + nFontHeight/4;
diff --git a/vcl/source/window/menuitemlist.cxx b/vcl/source/window/menuitemlist.cxx
index 505bdf72e98b..4fb7526982d8 100644
--- a/vcl/source/window/menuitemlist.cxx
+++ b/vcl/source/window/menuitemlist.cxx
@@ -99,7 +99,7 @@ void MenuItemList::InsertSeparator(const OString &rIdent, size_t nPos)
pData->nId = 0;
pData->sIdent = rIdent;
pData->eType = MenuItemType::SEPARATOR;
- pData->nBits = 0;
+ pData->nBits = MenuItemBits::NONE;
pData->pSubMenu = NULL;
pData->pAutoSubMenu = NULL;
pData->nUserValue = 0;
@@ -113,7 +113,7 @@ void MenuItemList::InsertSeparator(const OString &rIdent, size_t nPos)
SalItemParams aSalMIData;
aSalMIData.nId = 0;
aSalMIData.eType = MenuItemType::SEPARATOR;
- aSalMIData.nBits = 0;
+ aSalMIData.nBits = MenuItemBits::NONE;
aSalMIData.pMenu = NULL;
aSalMIData.aText = OUString();
aSalMIData.aImage = Image();
diff --git a/vcl/source/window/menuitemlist.hxx b/vcl/source/window/menuitemlist.hxx
index da69193770db..619e3eb89f00 100644
--- a/vcl/source/window/menuitemlist.hxx
+++ b/vcl/source/window/menuitemlist.hxx
@@ -60,7 +60,7 @@ struct MenuItemData
MenuItemData()
: nId(0)
, eType(MenuItemType::DONTKNOW)
- , nBits(0)
+ , nBits(MenuItemBits::NONE)
, pSubMenu(NULL)
, pAutoSubMenu(NULL)
, nUserValue(0)
@@ -76,7 +76,7 @@ struct MenuItemData
MenuItemData( const OUString& rStr, const Image& rImage )
: nId(0)
, eType(MenuItemType::DONTKNOW)
- , nBits(0)
+ , nBits(MenuItemBits::NONE)
, pSubMenu(NULL)
, pAutoSubMenu(NULL)
, aText(rStr)
@@ -94,7 +94,7 @@ struct MenuItemData
~MenuItemData();
bool HasCheck() const
{
- return bChecked || ( nBits & ( MIB_RADIOCHECK | MIB_CHECKABLE | MIB_AUTOCHECK ) );
+ return bChecked || ( nBits & ( MenuItemBits::RADIOCHECK | MenuItemBits::CHECKABLE | MenuItemBits::AUTOCHECK ) );
}
};
diff --git a/vcl/source/window/toolbox2.cxx b/vcl/source/window/toolbox2.cxx
index fb42808e5ff0..0113b12fccd9 100644
--- a/vcl/source/window/toolbox2.cxx
+++ b/vcl/source/window/toolbox2.cxx
@@ -1840,7 +1840,7 @@ void ToolBox::UpdateCustomMenu()
if( it->IsClipped() )
{
sal_uInt16 id = it->mnId + TOOLBOX_MENUITEM_START;
- pMenu->InsertItem( id, it->maText, it->maImage, 0, OString());
+ pMenu->InsertItem( id, it->maText, it->maImage, MenuItemBits::NONE, OString());
pMenu->EnableItem( id, it->mbEnabled );
pMenu->CheckItem ( id, it->meState == TRISTATE_TRUE );
}
@@ -1856,7 +1856,7 @@ void ToolBox::UpdateCustomMenu()
if( it->IsItemHidden() )
{
sal_uInt16 id = it->mnId + TOOLBOX_MENUITEM_START;
- pMenu->InsertItem( id, it->maText, it->maImage, 0, OString() );
+ pMenu->InsertItem( id, it->maText, it->maImage, MenuItemBits::NONE, OString() );
pMenu->EnableItem( id, it->mbEnabled );
pMenu->CheckItem( id, it->meState == TRISTATE_TRUE );
}
diff --git a/vcl/unx/gtk/window/gtksalmenu.cxx b/vcl/unx/gtk/window/gtksalmenu.cxx
index 676e68c5f5a5..456c2db0e72f 100644
--- a/vcl/unx/gtk/window/gtksalmenu.cxx
+++ b/vcl/unx/gtk/window/gtksalmenu.cxx
@@ -565,7 +565,7 @@ void GtkSalMenu::NativeCheckItem( unsigned nSection, unsigned nItemPos, MenuItem
GVariant *pCheckValue = NULL;
GVariant *pCurrentState = g_action_group_get_action_state( mpActionGroup, aCommand );
- if ( bits & MIB_RADIOCHECK )
+ if ( bits & MenuItemBits::RADIOCHECK )
pCheckValue = bCheck ? g_variant_new_string( aCommand ) : g_variant_new_string( "" );
else
{
@@ -659,7 +659,7 @@ void GtkSalMenu::NativeSetItemCommand( unsigned nSection,
GVariant *pTarget = NULL;
if ( g_action_group_has_action( mpActionGroup, aCommand ) == FALSE ) {
- if ( ( nBits & MIB_CHECKABLE ) || bIsSubmenu )
+ if ( ( nBits & MenuItemBits::CHECKABLE ) || bIsSubmenu )
{
// Item is a checkmark button.
GVariantType* pStateType = g_variant_type_new( (gchar*) G_VARIANT_TYPE_BOOLEAN );
@@ -667,7 +667,7 @@ void GtkSalMenu::NativeSetItemCommand( unsigned nSection,
g_lo_action_group_insert_stateful( pActionGroup, aCommand, nId, bIsSubmenu, NULL, pStateType, NULL, pState );
}
- else if ( nBits & MIB_RADIOCHECK )
+ else if ( nBits & MenuItemBits::RADIOCHECK )
{
// Item is a radio button.
GVariantType* pParameterType = g_variant_type_new( (gchar*) G_VARIANT_TYPE_STRING );