diff options
author | Noel Grandin <noel@peralex.com> | 2015-03-23 15:20:12 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2015-03-24 09:36:58 +0200 |
commit | ecec9afe852d3bca019b6b44a40d8be39e0f58f4 (patch) | |
tree | dc030eaa8f80a0dc3ff6103507ed4dabf9558bbd /include | |
parent | 5d37fa2a710e3bd76d3f1e18d1d66b8a4ab15030 (diff) |
convert SVX_ZOOM_ENABLE constants to enum class
Change-Id: Iead354b95b832edd72eb8e881855f228fd85be70
Diffstat (limited to 'include')
-rw-r--r-- | include/sfx2/zoomitem.hxx | 43 | ||||
-rw-r--r-- | include/svx/zoomctrl.hxx | 5 |
2 files changed, 27 insertions, 21 deletions
diff --git a/include/sfx2/zoomitem.hxx b/include/sfx2/zoomitem.hxx index 23542239c725..efc6a96644d2 100644 --- a/include/sfx2/zoomitem.hxx +++ b/include/sfx2/zoomitem.hxx @@ -22,7 +22,7 @@ #include <svl/intitem.hxx> #include <sfx2/sfxsids.hrc> #include <sfx2/dllapi.h> - +#include <o3tl/typed_flags_set.hxx> enum class SvxZoomType @@ -34,11 +34,27 @@ enum class SvxZoomType PAGEWIDTH_NOBORDER // GetValue() pagewidth without border }; - +enum class SvxZoomEnableFlags +{ + NONE = 0x0000, + N50 = 0x0001, + N75 = 0x0002, + N100 = 0x0004, + N150 = 0x0008, + N200 = 0x0010, + OPTIMAL = 0x1000, + WHOLEPAGE = 0x2000, + PAGEWIDTH = 0x4000, + ALL = 0x701F +}; +namespace o3tl +{ + template<> struct typed_flags<SvxZoomEnableFlags> : is_typed_flags<SvxZoomEnableFlags, 0x701f> {}; +} class SFX2_DLLPUBLIC SvxZoomItem: public SfxUInt16Item { - sal_uInt16 nValueSet; // allowed values (see #defines below) + SvxZoomEnableFlags nValueSet; // allowed values (see #defines below) SvxZoomType eType; public: @@ -49,14 +65,13 @@ public: SvxZoomItem( const SvxZoomItem& ); virtual ~SvxZoomItem(); - void SetValueSet( sal_uInt16 nValues ) { nValueSet = nValues; } - sal_uInt16 GetValueSet() const { return nValueSet; } - bool IsValueAllowed( sal_uInt16 nValue ) const - { return nValue == ( nValue & nValueSet ); } + void SetValueSet( SvxZoomEnableFlags nValues ) { nValueSet = nValues; } + SvxZoomEnableFlags GetValueSet() const { return nValueSet; } + bool IsValueAllowed( SvxZoomEnableFlags nValue ) const + { return bool( nValue & nValueSet ); } SvxZoomType GetType() const { return eType; } - void SetType( SvxZoomType eNewType ) - { eType = eNewType; } + void SetType( SvxZoomType eNewType ) { eType = eNewType; } virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const SAL_OVERRIDE; virtual SfxPoolItem* Create( SvStream& rStrm, sal_uInt16 nVersion ) const SAL_OVERRIDE; @@ -68,16 +83,6 @@ public: -#define SVX_ZOOM_ENABLE_50 0x0001 -#define SVX_ZOOM_ENABLE_75 0x0002 -#define SVX_ZOOM_ENABLE_100 0x0004 -#define SVX_ZOOM_ENABLE_150 0x0008 -#define SVX_ZOOM_ENABLE_200 0x0010 -#define SVX_ZOOM_ENABLE_OPTIMAL 0x1000 -#define SVX_ZOOM_ENABLE_WHOLEPAGE 0x2000 -#define SVX_ZOOM_ENABLE_PAGEWIDTH 0x4000 -#define SVX_ZOOM_ENABLE_ALL 0x701F - #endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/zoomctrl.hxx b/include/svx/zoomctrl.hxx index c6937ee3f69a..c82918126ccc 100644 --- a/include/svx/zoomctrl.hxx +++ b/include/svx/zoomctrl.hxx @@ -21,13 +21,14 @@ #include <sfx2/stbitem.hxx> #include <svx/svxdllapi.h> +#include <sfx2/zoomitem.hxx> #include <vcl/image.hxx> class SVX_DLLPUBLIC SvxZoomStatusBarControl : public SfxStatusBarControl { private: - sal_uInt16 nZoom; - sal_uInt16 nValueSet; + sal_uInt16 nZoom; + SvxZoomEnableFlags nValueSet; public: virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState, |