diff options
author | Noel Grandin <noel@peralex.com> | 2014-11-01 14:50:30 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2014-11-01 14:53:39 +0000 |
commit | a7542d38ddeebd37ddea233fa1e4cf15b2e03c49 (patch) | |
tree | 07ec3f89a4487b42c8b8203fab9e4dbb6f394a9c /include | |
parent | b812374174144e077bc3b08fe347626cb1a33eee (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>
Diffstat (limited to 'include')
-rw-r--r-- | include/rsc/rsc-vcl-shared-types.hxx | 31 | ||||
-rw-r--r-- | include/svtools/toolbarmenu.hxx | 6 | ||||
-rw-r--r-- | include/vcl/menu.hxx | 6 |
3 files changed, 24 insertions, 19 deletions
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 ); |