From cd23e6d3dd1c95b7cd74796612637cbc0f2af5fb Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Fri, 17 Apr 2015 09:57:29 +0200 Subject: convert BorderWidth flags to scoped enum Change-Id: I99214dc2056122158df9d861e3fb3e44bf0b16f6 --- include/svtools/ctrlbox.hxx | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) (limited to 'include') 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 #include +#include 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 : is_typed_flags {}; +} 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 ); -- cgit