summaryrefslogtreecommitdiff
path: root/sc/inc/attrib.hxx
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2016-05-18 11:56:40 +0200
committerNoel Grandin <noelgrandin@gmail.com>2016-05-25 09:12:04 +0000
commit233df63c540f4431ae67693021309ccb66b8f764 (patch)
tree1672c18d8448e2472993e0f3066ee0c4c5914fe5 /sc/inc/attrib.hxx
parentdc24a1d86c2bb3232c734b1a9d098f7331f47f99 (diff)
Convert SC_MF to scoped enum
Change-Id: I3089006b502e33710bfb2564f051ebf2892ad08a Reviewed-on: https://gerrit.libreoffice.org/25085 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'sc/inc/attrib.hxx')
-rw-r--r--sc/inc/attrib.hxx48
1 files changed, 28 insertions, 20 deletions
diff --git a/sc/inc/attrib.hxx b/sc/inc/attrib.hxx
index 2fcb3fcc4ca5..a3374e8c4ec2 100644
--- a/sc/inc/attrib.hxx
+++ b/sc/inc/attrib.hxx
@@ -23,22 +23,28 @@
#include <svl/poolitem.hxx>
#include <svl/intitem.hxx>
#include <svl/eitem.hxx>
+#include <o3tl/typed_flags_set.hxx>
#include "scdllapi.h"
#include "global.hxx"
#include "address.hxx"
- // flags for cells hidden by merge
- // and control for auto filter
-#define SC_MF_HOR 0x0001
-#define SC_MF_VER 0x0002
-#define SC_MF_AUTO 0x0004 /// autofilter arrow
-#define SC_MF_BUTTON 0x0008 /// field button for datapilot
-#define SC_MF_SCENARIO 0x0010
-#define SC_MF_BUTTON_POPUP 0x0020 /// dp button with popup arrow
-#define SC_MF_HIDDEN_MEMBER 0x0040 /// dp field button with presence of hidden member
-#define SC_MF_DP_TABLE 0x0080 /// dp table output
-
-#define SC_MF_ALL 0x00FF
+// flags for cells hidden by merge
+// and control for auto filter
+enum class ScMF {
+ NONE = 0x0000,
+ Hor = 0x0001,
+ Ver = 0x0002,
+ Auto = 0x0004, /// autofilter arrow
+ Button = 0x0008, /// field button for datapilot
+ Scenario = 0x0010,
+ ButtonPopup = 0x0020, /// dp button with popup arrow
+ HiddenMember = 0x0040, /// dp field button with presence of hidden member
+ DpTable = 0x0080, /// dp table output
+ All = 0x00FF
+};
+namespace o3tl {
+ template<> struct typed_flags<ScMF> : is_typed_flags<ScMF, 0xff> {};
+}
class EditTextObject;
namespace editeng { class SvxBorderLine; }
@@ -77,21 +83,23 @@ class SC_DLLPUBLIC ScMergeFlagAttr: public SfxInt16Item
{
public:
ScMergeFlagAttr();
- ScMergeFlagAttr(sal_Int16 nFlags);
+ ScMergeFlagAttr(ScMF nFlags);
virtual ~ScMergeFlagAttr();
SfxPoolItem * Clone(SfxItemPool * pPool) const override;
- bool IsHorOverlapped() const { return ( GetValue() & SC_MF_HOR ) != 0; }
- bool IsVerOverlapped() const { return ( GetValue() & SC_MF_VER ) != 0; }
- bool IsOverlapped() const { return ( GetValue() & ( SC_MF_HOR | SC_MF_VER ) ) != 0; }
+ ScMF GetValue() const { return (ScMF) SfxInt16Item::GetValue(); }
+
+ bool IsHorOverlapped() const { return bool( GetValue() & ScMF::Hor ); }
+ bool IsVerOverlapped() const { return bool( GetValue() & ScMF::Ver ); }
+ bool IsOverlapped() const { return bool( GetValue() & ( ScMF::Hor | ScMF::Ver ) ); }
- bool HasAutoFilter() const { return ( GetValue() & SC_MF_AUTO ) != 0; }
+ bool HasAutoFilter() const { return bool( GetValue() & ScMF::Auto ); }
- bool IsScenario() const { return ( GetValue() & SC_MF_SCENARIO ) != 0; }
+ bool IsScenario() const { return bool( GetValue() & ScMF::Scenario ); }
- bool HasPivotButton() const;
- bool HasPivotPopupButton() const;
+ bool HasPivotButton() const;
+ bool HasPivotPopupButton() const;
};
class SC_DLLPUBLIC ScProtectionAttr: public SfxPoolItem