diff options
author | Noel Grandin <noel@peralex.com> | 2014-10-18 20:16:11 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2014-10-20 07:16:46 +0000 |
commit | 67c9d054517fc3b5cbc203c330eedef4b50f0e57 (patch) | |
tree | 1fad773f770e4ee4265bb05ba77d7f3084aedd3b /include | |
parent | 8091cf383a122f2348d6e25df90fc26579fe6ef7 (diff) |
fdo#84938: replace TIB_ constants with enum
Change-Id: I435ce2331fb49e7ce9fe97bdfddfaef706759a84
Reviewed-on: https://gerrit.libreoffice.org/12023
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 | 33 | ||||
-rw-r--r-- | include/sfx2/sidebar/SidebarToolBox.hxx | 2 | ||||
-rw-r--r-- | include/vcl/toolbox.hxx | 10 |
3 files changed, 26 insertions, 19 deletions
diff --git a/include/rsc/rsc-vcl-shared-types.hxx b/include/rsc/rsc-vcl-shared-types.hxx index 051cd71303f1..1c1441204026 100644 --- a/include/rsc/rsc-vcl-shared-types.hxx +++ b/include/rsc/rsc-vcl-shared-types.hxx @@ -21,6 +21,7 @@ #define INCLUDED_RSC_RSC_VCL_SHARED_TYPES_HXX #include <sal/types.h> +#include <o3tl/typed_flags_set.hxx> enum TimeFieldFormat {TIMEF_NONE, TIMEF_SEC, TIMEF_100TH_SEC, TIMEF_SEC_CS, TimeFieldFormat_FORCE_EQUAL_SIZE=SAL_MAX_ENUM }; @@ -48,19 +49,25 @@ typedef sal_uInt16 MenuItemBits; #define MIB_ICON ((MenuItemBits)0x0080) #define MIB_TEXT ((MenuItemBits)0x0100) -typedef sal_uInt16 ToolBoxItemBits; - -#define TIB_CHECKABLE ((ToolBoxItemBits)0x0001) -#define TIB_RADIOCHECK ((ToolBoxItemBits)0x0002) -#define TIB_AUTOCHECK ((ToolBoxItemBits)0x0004) -#define TIB_LEFT ((ToolBoxItemBits)0x0008) -#define TIB_AUTOSIZE ((ToolBoxItemBits)0x0010) -#define TIB_DROPDOWN ((ToolBoxItemBits)0x0020) -#define TIB_REPEAT ((ToolBoxItemBits)0x0040) -#define TIB_DROPDOWNONLY ((ToolBoxItemBits)0x0080 | TIB_DROPDOWN) -#define TIB_TEXT_ONLY ((ToolBoxItemBits)0x0100) -#define TIB_ICON_ONLY ((ToolBoxItemBits)0x0200) -#define TIB_TEXTICON ((ToolBoxItemBits) TIB_TEXT_ONLY | TIB_ICON_ONLY ) +enum class ToolBoxItemBits : sal_uInt16 +{ + NONE = 0x0000, + CHECKABLE = 0x0001, + RADIOCHECK = 0x0002, + AUTOCHECK = 0x0004, + LEFT = 0x0008, + AUTOSIZE = 0x0010, + DROPDOWN = 0x0020, + REPEAT = 0x0040, + DROPDOWNONLY = 0x00a0, // 0x0080 | TIB_DROPDOWN + TEXT_ONLY = 0x0100, + ICON_ONLY = 0x0200, + TEXTICON = 0x0300 // TIB_TEXT_ONLY | TIB_ICON_ONLY +}; +namespace o3tl +{ + template<> struct typed_flags<ToolBoxItemBits> : is_typed_flags<ToolBoxItemBits, 0x3ff> {}; +} enum ToolBoxItemType { TOOLBOXITEM_DONTKNOW, TOOLBOXITEM_BUTTON, TOOLBOXITEM_SPACE, TOOLBOXITEM_SEPARATOR, diff --git a/include/sfx2/sidebar/SidebarToolBox.hxx b/include/sfx2/sidebar/SidebarToolBox.hxx index 0a6f37fa8463..381745da7648 100644 --- a/include/sfx2/sidebar/SidebarToolBox.hxx +++ b/include/sfx2/sidebar/SidebarToolBox.hxx @@ -45,7 +45,7 @@ public: using ToolBox::InsertItem; virtual void InsertItem(const OUString& rCommand, const com::sun::star::uno::Reference<com::sun::star::frame::XFrame>& rFrame, - ToolBoxItemBits nBits = 0, + ToolBoxItemBits nBits = ToolBoxItemBits::NONE, const Size& rRequestedSize = Size(), sal_uInt16 nPos = TOOLBOX_APPEND) SAL_OVERRIDE; diff --git a/include/vcl/toolbox.hxx b/include/vcl/toolbox.hxx index 7bde25e90362..e8161b7407c3 100644 --- a/include/vcl/toolbox.hxx +++ b/include/vcl/toolbox.hxx @@ -328,21 +328,21 @@ public: /// Insert a command (like '.uno:Save'). virtual void InsertItem( const OUString& rCommand, const css::uno::Reference<css::frame::XFrame>& rFrame, - ToolBoxItemBits nBits = 0, + ToolBoxItemBits nBits = ToolBoxItemBits::NONE, const Size& rRequestedSize = Size(), sal_uInt16 nPos = TOOLBOX_APPEND ); void InsertItem( sal_uInt16 nItemId, const Image& rImage, - ToolBoxItemBits nBits = 0, + ToolBoxItemBits nBits = ToolBoxItemBits::NONE, sal_uInt16 nPos = TOOLBOX_APPEND ); void InsertItem( sal_uInt16 nItemId, const Image& rImage, const OUString& rText, - ToolBoxItemBits nBits = 0, + ToolBoxItemBits nBits = ToolBoxItemBits::NONE, sal_uInt16 nPos = TOOLBOX_APPEND ); void InsertItem( sal_uInt16 nItemId, const OUString& rText, - ToolBoxItemBits nBits = 0, + ToolBoxItemBits nBits = ToolBoxItemBits::NONE, sal_uInt16 nPos = TOOLBOX_APPEND ); void InsertWindow( sal_uInt16 nItemId, vcl::Window* pWindow, - ToolBoxItemBits nBits = 0, + ToolBoxItemBits nBits = ToolBoxItemBits::NONE, sal_uInt16 nPos = TOOLBOX_APPEND ); void InsertSpace( sal_uInt16 nPos = TOOLBOX_APPEND ); void InsertSeparator( sal_uInt16 nPos = TOOLBOX_APPEND, |