summaryrefslogtreecommitdiff
path: root/include/svtools
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-04-17 09:57:29 +0200
committerNoel Grandin <noel@peralex.com>2015-04-22 10:28:39 +0200
commitcd23e6d3dd1c95b7cd74796612637cbc0f2af5fb (patch)
tree5e81962c277e8b694f733e85b18a5a2d2b21eb3e /include/svtools
parent0578aa4de27cc960cd3709eb2e15f40e02e1272d (diff)
convert BorderWidth flags to scoped enum
Change-Id: I99214dc2056122158df9d861e3fb3e44bf0b16f6
Diffstat (limited to 'include/svtools')
-rw-r--r--include/svtools/ctrlbox.hxx22
1 files changed, 15 insertions, 7 deletions
diff --git a/include/svtools/ctrlbox.hxx b/include/svtools/ctrlbox.hxx
index 55af3e0e948e..fe29ee120083 100644
--- a/include/svtools/ctrlbox.hxx
+++ b/include/svtools/ctrlbox.hxx
@@ -30,6 +30,7 @@
#include <vcl/field.hxx>
#include <com/sun/star/table/BorderLineStyle.hpp>
+#include <o3tl/typed_flags_set.hxx>
class FontList;
class ImplColorListData;
@@ -39,11 +40,6 @@ typedef ::std::vector< ImplColorListData* > ImpColorList;
typedef ::std::vector< ImpLineListData* > ImpLineList;
typedef ::std::vector< vcl::FontInfo > ImplFontList;
-#define CHANGE_LINE1 ( ( sal_uInt16 ) 1 )
-#define CHANGE_LINE2 ( ( sal_uInt16 ) 2 )
-#define CHANGE_DIST ( ( sal_uInt16 ) 4 )
-#define ADAPT_DIST ( ( sal_uInt16 ) 8 )
-
/*************************************************************************
Description
@@ -238,16 +234,28 @@ inline Color ColorListBox::GetSelectEntryColor( sal_Int32 nSelIndex ) const
For each line, the rate member is used as a multiplication factor is the width
isn't fixed. Otherwise it is the width in the unit expected by the client code.
*/
+enum class BorderWidthImplFlags
+{
+ FIXED = 0,
+ CHANGE_LINE1 = 1,
+ CHANGE_LINE2 = 2,
+ CHANGE_DIST = 4,
+ ADAPT_DIST = 8,
+};
+namespace o3tl
+{
+ template<> struct typed_flags<BorderWidthImplFlags> : is_typed_flags<BorderWidthImplFlags, 0x0f> {};
+}
class SVT_DLLPUBLIC BorderWidthImpl
{
- sal_uInt16 m_nFlags;
+ BorderWidthImplFlags m_nFlags;
double m_nRate1;
double m_nRate2;
double m_nRateGap;
public:
- BorderWidthImpl( sal_uInt16 nFlags = CHANGE_LINE1, double nRate1 = 0.0,
+ BorderWidthImpl( BorderWidthImplFlags nFlags = BorderWidthImplFlags::CHANGE_LINE1, double nRate1 = 0.0,
double nRate2 = 0.0, double nRateGap = 0.0 );
BorderWidthImpl& operator= ( const BorderWidthImpl& r );