summaryrefslogtreecommitdiff
path: root/include/svtools
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-10-03 15:37:02 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-10-03 16:55:11 +0200
commit2b6385a9f58e9f8adfd406e087186eb0cbba700b (patch)
tree192db26b5fed1c91f3a737ef53e75c9071dddbda /include/svtools
parent532a4dcba6ec6fe1bd88f3c2db77f05868167886 (diff)
convert TPB_DISPLAY_NAME constants to scoped enum
Change-Id: I0e4f9ce3392e48fc82c232ba3e6581f3b0d9af9f Reviewed-on: https://gerrit.libreoffice.org/43083 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'include/svtools')
-rw-r--r--include/svtools/tabbar.hxx25
1 files changed, 15 insertions, 10 deletions
diff --git a/include/svtools/tabbar.hxx b/include/svtools/tabbar.hxx
index 766ac7d4744f..48ac6d1f679f 100644
--- a/include/svtools/tabbar.hxx
+++ b/include/svtools/tabbar.hxx
@@ -23,6 +23,7 @@
#include <svtools/svtdllapi.h>
#include <tools/link.hxx>
#include <vcl/window.hxx>
+#include <o3tl/typed_flags_set.hxx>
#include <memory>
#include <vector>
@@ -49,13 +50,13 @@ Allowed PageBits
Setting page bits modify the display attributes of the tab name
-TPB_DISPLAY_NAME_BLUE
+TabBarPageBits::Blue
- Display tab name in light blue, used in draw for
invisible layers and in calc for scenario pages
-TPB_DISPLAY_NAME_ITALIC
+TabBarPageBits::Italic
- Display tab name italic, used in draw for
locked layers
-TPB_DISPLAY_NAME_UNDERLINE
+TabBarPageBits::Underline
- Display tab name underlined, used in draw for
non-printable layers
@@ -276,15 +277,19 @@ class Button;
// Page bits
-typedef sal_uInt16 TabBarPageBits;
-
-#define TPB_DISPLAY_NAME_BLUE ((TabBarPageBits)0x0001)
-#define TPB_DISPLAY_NAME_ITALIC ((TabBarPageBits)0x0002)
-#define TPB_DISPLAY_NAME_UNDERLINE ((TabBarPageBits)0x0004)
+enum class TabBarPageBits {
+ NONE = 0x00,
+ Blue = 0x01,
+ Italic = 0x02,
+ Underline = 0x04,
+};
+namespace o3tl {
+ template<> struct typed_flags<TabBarPageBits> : is_typed_flags<TabBarPageBits, 0x07> {};
+};
// interface checks only, do not use in regular control flow
-#define TPB_DISPLAY_NAME_ALLFLAGS ((TabBarPageBits)(TPB_DISPLAY_NAME_BLUE | TPB_DISPLAY_NAME_ITALIC | TPB_DISPLAY_NAME_UNDERLINE))
+#define TPB_DISPLAY_NAME_ALLFLAGS (TabBarPageBits::Blue | TabBarPageBits::Italic | TabBarPageBits::Underline)
// - TabBar-Types - used in TabBar::AllowRenaming
@@ -403,7 +408,7 @@ public:
virtual void Mirror();
void InsertPage( sal_uInt16 nPageId, const OUString& rText,
- TabBarPageBits nBits = 0,
+ TabBarPageBits nBits = TabBarPageBits::NONE,
sal_uInt16 nPos = TabBar::APPEND );
void RemovePage( sal_uInt16 nPageId );
void MovePage( sal_uInt16 nPageId, sal_uInt16 nNewPos );