summaryrefslogtreecommitdiff
path: root/vcl/source
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2016-05-14 20:11:29 +0200
committerNoel Grandin <noelgrandin@gmail.com>2016-05-16 06:42:57 +0000
commitee6af9f72c298972d7f255aa92f365b33a9e53b2 (patch)
treed140aea776f65c9778a231920b8e93f0c346022e /vcl/source
parent743cdf36d128bc1d0ea3315675b0bb5f85388099 (diff)
convert RSC_MENUITEM to scoped enum
Change-Id: I35469edc7d8e5621f016f5eba613474d45711cd3 Reviewed-on: https://gerrit.libreoffice.org/24998 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'vcl/source')
-rw-r--r--vcl/source/window/menu.cxx35
1 files changed, 12 insertions, 23 deletions
diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx
index 075c53b8fb16..ce465f9c3a6f 100644
--- a/vcl/source/window/menu.cxx
+++ b/vcl/source/window/menu.cxx
@@ -427,29 +427,29 @@ void Menu::InsertItem( const ResId& rResId )
if( ! pMgr )
return;
- sal_uLong nObjMask;
+ RscMenuItem nObjMask;
GetRes( rResId.SetRT( RSC_MENUITEM ) );
- nObjMask = ReadLongRes();
+ nObjMask = (RscMenuItem)ReadLongRes();
bool bSep = false;
- if ( nObjMask & RSC_MENUITEM_SEPARATOR )
+ if ( nObjMask & RscMenuItem::Separator )
bSep = ReadShortRes() != 0;
sal_uInt16 nItemId = 1;
- if ( nObjMask & RSC_MENUITEM_ID )
+ if ( nObjMask & RscMenuItem::Id )
nItemId = sal::static_int_cast<sal_uInt16>(ReadLongRes());
MenuItemBits nStatus = MenuItemBits::NONE;
- if ( nObjMask & RSC_MENUITEM_STATUS )
+ if ( nObjMask & RscMenuItem::Status )
nStatus = sal::static_int_cast<MenuItemBits>(ReadLongRes());
OUString aText;
- if ( nObjMask & RSC_MENUITEM_TEXT )
+ if ( nObjMask & RscMenuItem::Text )
aText = ReadStringRes();
// create item
- if ( nObjMask & RSC_MENUITEM_BITMAP )
+ if ( nObjMask & RscMenuItem::Bitmap )
{
if ( !bSep )
{
@@ -468,14 +468,14 @@ void Menu::InsertItem( const ResId& rResId )
InsertSeparator();
OUString aHelpText;
- if ( nObjMask & RSC_MENUITEM_HELPTEXT )
+ if ( nObjMask & RscMenuItem::HelpText )
{
aHelpText = ReadStringRes();
if( !bSep )
SetHelpText( nItemId, aHelpText );
}
- if ( nObjMask & RSC_MENUITEM_HELPID )
+ if ( nObjMask & RscMenuItem::HelpId )
{
OString aHelpId( ReadByteStringRes() );
if ( !bSep )
@@ -485,29 +485,18 @@ void Menu::InsertItem( const ResId& rResId )
if( !bSep )
SetHelpText( nItemId, aHelpText );
- if ( nObjMask & RSC_MENUITEM_KEYCODE )
- {
- if ( !bSep )
- SetAccelKey( nItemId, KeyCode( ResId( static_cast<RSHEADER_TYPE*>(GetClassRes()), *pMgr ) ) );
- IncrementRes( GetObjSizeRes( static_cast<RSHEADER_TYPE*>(GetClassRes()) ) );
- }
- if( nObjMask & RSC_MENUITEM_CHECKED )
- {
- if ( !bSep )
- CheckItem( nItemId, ReadShortRes() != 0 );
- }
- if ( nObjMask & RSC_MENUITEM_DISABLE )
+ if ( nObjMask & RscMenuItem::Disable )
{
if ( !bSep )
EnableItem( nItemId, ReadShortRes() == 0 );
}
- if ( nObjMask & RSC_MENUITEM_COMMAND )
+ if ( nObjMask & RscMenuItem::Command )
{
OUString aCommandStr = ReadStringRes();
if ( !bSep )
SetItemCommand( nItemId, aCommandStr );
}
- if ( nObjMask & RSC_MENUITEM_MENU )
+ if ( nObjMask & RscMenuItem::Menu )
{
if ( !bSep )
{