diff options
author | Noel Grandin <noel@peralex.com> | 2016-05-18 08:55:06 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2016-05-24 13:14:25 +0000 |
commit | 2bc173abb63b2146c05fdea79c239b82c1bc5daf (patch) | |
tree | d2267e4529c0f689eb78b1347f5ad068b7f99321 /sc/inc | |
parent | d31935043f7b4ce44811cd6de51f64eb207a6b3a (diff) |
convert PIVOT_FUNC to scoped enum
Change-Id: I6d50ad6fa0dbe7b21ad73e14dc2df3c854d08153
Reviewed-on: https://gerrit.libreoffice.org/25076
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Eike Rathke <erack@redhat.com>
Diffstat (limited to 'sc/inc')
-rw-r--r-- | sc/inc/dapiuno.hxx | 4 | ||||
-rw-r--r-- | sc/inc/dpglobal.hxx | 34 | ||||
-rw-r--r-- | sc/inc/pivot.hxx | 8 | ||||
-rw-r--r-- | sc/inc/scabstdlg.hxx | 4 |
4 files changed, 29 insertions, 21 deletions
diff --git a/sc/inc/dapiuno.hxx b/sc/inc/dapiuno.hxx index 8d7b324fee8f..b4b8d6e26837 100644 --- a/sc/inc/dapiuno.hxx +++ b/sc/inc/dapiuno.hxx @@ -70,8 +70,8 @@ class ScDataPilotItemObj; class ScDataPilotConversion { public: - static css::sheet::GeneralFunction FirstFunc( sal_uInt16 nBits ); - static sal_uInt16 FunctionBit( css::sheet::GeneralFunction eFunc ); + static css::sheet::GeneralFunction FirstFunc( PivotFunc nBits ); + static PivotFunc FunctionBit( css::sheet::GeneralFunction eFunc ); static void FillGroupInfo( css::sheet::DataPilotFieldGroupInfo& rInfo, diff --git a/sc/inc/dpglobal.hxx b/sc/inc/dpglobal.hxx index 3bbaeab2548c..e6ca2c2ea838 100644 --- a/sc/inc/dpglobal.hxx +++ b/sc/inc/dpglobal.hxx @@ -20,20 +20,28 @@ #ifndef INCLUDED_SC_INC_DPGLOBAL_HXX #define INCLUDED_SC_INC_DPGLOBAL_HXX +#include <o3tl/typed_flags_set.hxx> + #define PIVOT_MAXFUNC 11 -#define PIVOT_FUNC_NONE 0x0000 -#define PIVOT_FUNC_SUM 0x0001 -#define PIVOT_FUNC_COUNT 0x0002 -#define PIVOT_FUNC_AVERAGE 0x0004 -#define PIVOT_FUNC_MAX 0x0008 -#define PIVOT_FUNC_MIN 0x0010 -#define PIVOT_FUNC_PRODUCT 0x0020 -#define PIVOT_FUNC_COUNT_NUM 0x0040 -#define PIVOT_FUNC_STD_DEV 0x0080 -#define PIVOT_FUNC_STD_DEVP 0x0100 -#define PIVOT_FUNC_STD_VAR 0x0200 -#define PIVOT_FUNC_STD_VARP 0x0400 -#define PIVOT_FUNC_AUTO 0x1000 + +enum class PivotFunc { + NONE = 0x0000, + Sum = 0x0001, + Count = 0x0002, + Average = 0x0004, + Max = 0x0008, + Min = 0x0010, + Product = 0x0020, + CountNum = 0x0040, + StdDev = 0x0080, + StdDevP = 0x0100, + StdVar = 0x0200, + StdVarP = 0x0400, + Auto = 0x1000 +}; +namespace o3tl { + template<> struct typed_flags<PivotFunc> : is_typed_flags<PivotFunc, 0x17ff> {}; +} struct ScDPValue { diff --git a/sc/inc/pivot.hxx b/sc/inc/pivot.hxx index c0c21cca1860..ae3fdd5a9167 100644 --- a/sc/inc/pivot.hxx +++ b/sc/inc/pivot.hxx @@ -69,7 +69,7 @@ struct ScDPLabelData OUString maSubtotalName; SCCOL mnCol; ///< 0-based field index (not the source column index) long mnOriginalDim; ///< original dimension index (>= 0 for duplicated dimension) - sal_uInt16 mnFuncMask; ///< Page/Column/Row subtotal function. + PivotFunc mnFuncMask; ///< Page/Column/Row subtotal function. sal_Int32 mnUsedHier; ///< Used hierarchy. sal_Int32 mnFlags; ///< Flags from the DataPilotSource dimension sal_uInt8 mnDupCount; @@ -115,7 +115,7 @@ struct ScPivotField { SCCOL nCol; ///< 0-based dimension index (not source column index) long mnOriginalDim; ///< >= 0 for duplicated field. - sal_uInt16 nFuncMask; + PivotFunc nFuncMask; sal_uInt8 mnDupCount; css::sheet::DataPilotFieldReference maFieldRef; @@ -157,12 +157,12 @@ struct ScPivotFuncData { SCCOL mnCol; long mnOriginalDim; - sal_uInt16 mnFuncMask; + PivotFunc mnFuncMask; sal_uInt8 mnDupCount; css::sheet::DataPilotFieldReference maFieldRef; - explicit ScPivotFuncData( SCCOL nCol, sal_uInt16 nFuncMask ); + explicit ScPivotFuncData( SCCOL nCol, PivotFunc nFuncMask ); #if DEBUG_PIVOT_TABLE void Dump() const; diff --git a/sc/inc/scabstdlg.hxx b/sc/inc/scabstdlg.hxx index 050672a45bc0..8c6c6c50677f 100644 --- a/sc/inc/scabstdlg.hxx +++ b/sc/inc/scabstdlg.hxx @@ -240,14 +240,14 @@ public: class AbstractScDPFunctionDlg : public VclAbstractDialog { public: - virtual sal_uInt16 GetFuncMask() const = 0; + virtual PivotFunc GetFuncMask() const = 0; virtual css::sheet::DataPilotFieldReference GetFieldRef() const = 0; }; class AbstractScDPSubtotalDlg : public VclAbstractDialog { public: - virtual sal_uInt16 GetFuncMask() const = 0; + virtual PivotFunc GetFuncMask() const = 0; virtual void FillLabelData( ScDPLabelData& rLabelData ) const = 0; }; |