diff options
author | Noel Grandin <noel@peralex.com> | 2016-05-18 11:56:40 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2016-05-25 09:12:04 +0000 |
commit | 233df63c540f4431ae67693021309ccb66b8f764 (patch) | |
tree | 1672c18d8448e2472993e0f3066ee0c4c5914fe5 /sc/inc | |
parent | dc24a1d86c2bb3232c734b1a9d098f7331f47f99 (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')
-rw-r--r-- | sc/inc/attarray.hxx | 6 | ||||
-rw-r--r-- | sc/inc/attrib.hxx | 48 | ||||
-rw-r--r-- | sc/inc/column.hxx | 5 | ||||
-rw-r--r-- | sc/inc/document.hxx | 5 | ||||
-rw-r--r-- | sc/inc/table.hxx | 4 |
5 files changed, 39 insertions, 29 deletions
diff --git a/sc/inc/attarray.hxx b/sc/inc/attarray.hxx index 04aab80355f1..afff019bbde6 100644 --- a/sc/inc/attarray.hxx +++ b/sc/inc/attarray.hxx @@ -150,8 +150,8 @@ public: SCsROW& rRow, SCsROW& rEndRow, const ScStyleSheet* pSearchStyle, bool bUp, const ScMarkArray* pMarkArray = nullptr) const; - bool ApplyFlags( SCROW nStartRow, SCROW nEndRow, sal_Int16 nFlags ); - bool RemoveFlags( SCROW nStartRow, SCROW nEndRow, sal_Int16 nFlags ); + bool ApplyFlags( SCROW nStartRow, SCROW nEndRow, ScMF nFlags ); + bool RemoveFlags( SCROW nStartRow, SCROW nEndRow, ScMF nFlags ); bool Search( SCROW nRow, SCSIZE& nIndex ) const; @@ -187,7 +187,7 @@ public: void DeleteArea( SCROW nStartRow, SCROW nEndRow ); void MoveTo( SCROW nStartRow, SCROW nEndRow, ScAttrArray& rAttrArray ); void CopyArea( - SCROW nStartRow, SCROW nEndRow, long nDy, ScAttrArray& rAttrArray, sal_Int16 nStripFlags = 0) const; + SCROW nStartRow, SCROW nEndRow, long nDy, ScAttrArray& rAttrArray, ScMF nStripFlags = ScMF::NONE) const; void DeleteHardAttr( SCROW nStartRow, SCROW nEndRow ); 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 diff --git a/sc/inc/column.hxx b/sc/inc/column.hxx index 9a7e3cebf599..9754e5acb109 100644 --- a/sc/inc/column.hxx +++ b/sc/inc/column.hxx @@ -102,6 +102,7 @@ struct ScRefCellValue; struct ScCellValue; class ScDocumentImport; class ScHint; +enum class ScMF; struct ScNeededSizeOptions { @@ -479,8 +480,8 @@ public: SCsROW& rRow, SCsROW& rEndRow, const ScStyleSheet* pSearchStyle, bool bUp, bool bInSelection, const ScMarkData& rMark) const; - bool ApplyFlags( SCROW nStartRow, SCROW nEndRow, sal_Int16 nFlags ); - bool RemoveFlags( SCROW nStartRow, SCROW nEndRow, sal_Int16 nFlags ); + bool ApplyFlags( SCROW nStartRow, SCROW nEndRow, ScMF nFlags ); + bool RemoveFlags( SCROW nStartRow, SCROW nEndRow, ScMF nFlags ); void ClearItems( SCROW nStartRow, SCROW nEndRow, const sal_uInt16* pWhich ); void RemoveProtected( SCROW nStartRow, SCROW nEndRow ); diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx index 108c0c55798c..5696f260f789 100644 --- a/sc/inc/document.hxx +++ b/sc/inc/document.hxx @@ -48,6 +48,7 @@ #include "markdata.hxx" enum class SvtScriptType; +enum class ScMF; namespace editeng { class SvxBorderLine; } namespace formula { struct VectorRefArray; } namespace svl { @@ -1630,10 +1631,10 @@ public: SC_DLLPUBLIC bool ApplyFlagsTab( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, - SCTAB nTab, sal_Int16 nFlags ); + SCTAB nTab, ScMF nFlags ); SC_DLLPUBLIC bool RemoveFlagsTab( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, - SCTAB nTab, sal_Int16 nFlags ); + SCTAB nTab, ScMF nFlags ); SC_DLLPUBLIC void SetPattern( const ScAddress&, const ScPatternAttr& rAttr ); SC_DLLPUBLIC void SetPattern( SCCOL nCol, SCROW nRow, SCTAB nTab, const ScPatternAttr& rAttr ); diff --git a/sc/inc/table.hxx b/sc/inc/table.hxx index 3906e707c7da..b6e69c172e5b 100644 --- a/sc/inc/table.hxx +++ b/sc/inc/table.hxx @@ -649,8 +649,8 @@ public: bool IsStyleSheetUsed( const ScStyleSheet& rStyle ) const; - bool ApplyFlags( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, sal_Int16 nFlags ); - bool RemoveFlags( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, sal_Int16 nFlags ); + bool ApplyFlags( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, ScMF nFlags ); + bool RemoveFlags( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, ScMF nFlags ); void ApplySelectionCache( SfxItemPoolCache* pCache, const ScMarkData& rMark, ScEditDataArray* pDataArray = nullptr ); void DeleteSelection( InsertDeleteFlags nDelFlag, const ScMarkData& rMark, bool bBroadcast = true ); |