summaryrefslogtreecommitdiff
path: root/include/sfx2/zoomitem.hxx
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-03-23 15:20:12 +0200
committerNoel Grandin <noel@peralex.com>2015-03-24 09:36:58 +0200
commitecec9afe852d3bca019b6b44a40d8be39e0f58f4 (patch)
treedc030eaa8f80a0dc3ff6103507ed4dabf9558bbd /include/sfx2/zoomitem.hxx
parent5d37fa2a710e3bd76d3f1e18d1d66b8a4ab15030 (diff)
convert SVX_ZOOM_ENABLE constants to enum class
Change-Id: Iead354b95b832edd72eb8e881855f228fd85be70
Diffstat (limited to 'include/sfx2/zoomitem.hxx')
-rw-r--r--include/sfx2/zoomitem.hxx43
1 files changed, 24 insertions, 19 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: */