From 8e4a113229298b4fa5bddd6cf71715d1fb87c3ef Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Wed, 11 May 2016 09:52:15 +0200 Subject: Convert RULER_MARGIN to scoped enum Change-Id: Ia8711614fdb9090faeebfe294cbb064ded20b5fb Reviewed-on: https://gerrit.libreoffice.org/24874 Tested-by: Jenkins Reviewed-by: Noel Grandin --- include/svtools/ruler.hxx | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'include') diff --git a/include/svtools/ruler.hxx b/include/svtools/ruler.hxx index 0db49dc6561e..f7708ba76b36 100644 --- a/include/svtools/ruler.hxx +++ b/include/svtools/ruler.hxx @@ -484,7 +484,14 @@ enum class RulerDragSize { #define RULER_MOUSE_MARGINWIDTH 3 -#define RULER_MARGIN_SIZEABLE ((sal_uInt16)0x0001) +enum class RulerMarginStyle { + NONE = 0x0000, + Sizeable = 0x0001, + Invisible = 0x0002 +}; +namespace o3tl { + template<> struct typed_flags : is_typed_flags {}; +} enum class RulerBorderStyle { @@ -764,11 +771,11 @@ public: void SetNullOffset( long nPos ); long GetNullOffset() const; - void SetMargin1() { SetMargin1( 0, RULER_STYLE_INVISIBLE ); } - void SetMargin1( long nPos, sal_uInt16 nMarginStyle = RULER_MARGIN_SIZEABLE ); + void SetMargin1() { SetMargin1( 0, RulerMarginStyle::Invisible ); } + void SetMargin1( long nPos, RulerMarginStyle nMarginStyle = RulerMarginStyle::Sizeable ); long GetMargin1() const; - void SetMargin2() { SetMargin2( 0, RULER_STYLE_INVISIBLE ); } - void SetMargin2( long nPos, sal_uInt16 nMarginStyle = RULER_MARGIN_SIZEABLE ); + void SetMargin2() { SetMargin2( 0, RulerMarginStyle::Invisible ); } + void SetMargin2( long nPos, RulerMarginStyle nMarginStyle = RulerMarginStyle::Sizeable ); long GetMargin2() const; void SetLeftFrameMargin( long nPos ); -- cgit