diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-02-15 11:27:08 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-02-15 12:30:39 +0200 |
commit | 04004cc25905de47bb8406cb99be8fb34dd6f633 (patch) | |
tree | 52d70d0f1f01ea4a0fb9ffefef11dddd65151289 | |
parent | f4ae7da07703de3a7636f00213fd01cb548682a0 (diff) |
convert FuncParamValidity to scoped enum
and drop unused NONE enumerator
Change-Id: Ibc77390efb195a9158ba809ad96aab4dcdbc09cb
-rwxr-xr-x | compilerplugins/clang/unusedenumconstants.py | 1 | ||||
-rw-r--r-- | sc/source/filter/inc/formulabase.hxx | 11 | ||||
-rw-r--r-- | sc/source/filter/oox/formulabase.cxx | 30 |
3 files changed, 21 insertions, 21 deletions
diff --git a/compilerplugins/clang/unusedenumconstants.py b/compilerplugins/clang/unusedenumconstants.py index 975e23c656e4..5a71bf4ec275 100755 --- a/compilerplugins/clang/unusedenumconstants.py +++ b/compilerplugins/clang/unusedenumconstants.py @@ -112,6 +112,7 @@ for d in definitionSet: "include/svtools/rtftoken.h", # RTF_TOKEN_IDS "starmath/source/mathtype.hxx", # MathType::MTOKENS "sd/source/filter/eppt/epptbase.hxx", # PPTExTextAttr + "sc/source/filter/inc/tokstack.hxx", # E_TYPE # unit test code "cppu/source/uno/check.cxx", # general weird nonsense going on diff --git a/sc/source/filter/inc/formulabase.hxx b/sc/source/filter/inc/formulabase.hxx index e217165fe04d..a1924226d50b 100644 --- a/sc/source/filter/inc/formulabase.hxx +++ b/sc/source/filter/inc/formulabase.hxx @@ -367,12 +367,11 @@ struct ApiOpCodes // Function parameter info ==================================================== /** Enumerates validity modes for a function parameter. */ -enum FuncParamValidity +enum class FuncParamValidity { - FUNC_PARAM_NONE = 0, /// Default for an unspecified entry in a C-array. - FUNC_PARAM_REGULAR, /// Parameter supported by Calc and Excel. - FUNC_PARAM_CALCONLY, /// Parameter supported by Calc only. - FUNC_PARAM_EXCELONLY /// Parameter supported by Excel only. + Regular, /// Parameter supported by Calc and Excel. + CalcOnly, /// Parameter supported by Calc only. + ExcelOnly /// Parameter supported by Excel only. }; /** Structure that contains all needed information for a parameter in a @@ -474,7 +473,7 @@ enum FunctionLibraryType The member mpParamInfos points to a C-array of type information structures for all parameters of the function. The last initialized structure - describing a regular parameter (member meValid == FUNC_PARAM_REGULAR) in + describing a regular parameter (member meValid == FuncParamValidity::Regular) in this array is used repeatedly for all following parameters supported by a function. */ diff --git a/sc/source/filter/oox/formulabase.cxx b/sc/source/filter/oox/formulabase.cxx index 01de05aa613e..d0e73d5d54dc 100644 --- a/sc/source/filter/oox/formulabase.cxx +++ b/sc/source/filter/oox/formulabase.cxx @@ -203,18 +203,18 @@ const sal_uInt8 V = BIFF_TOKCLASS_VAL; const sal_uInt8 A = BIFF_TOKCLASS_ARR; // abbreviations for parameter infos -#define RO { FUNC_PARAM_REGULAR } -#define RA { FUNC_PARAM_REGULAR } -#define RR { FUNC_PARAM_REGULAR } -#define RX { FUNC_PARAM_REGULAR } -#define VO { FUNC_PARAM_REGULAR } -#define VV { FUNC_PARAM_REGULAR } -#define VA { FUNC_PARAM_REGULAR } -#define VR { FUNC_PARAM_REGULAR } -#define VX { FUNC_PARAM_REGULAR } -#define RO_E { FUNC_PARAM_EXCELONLY } -#define VR_E { FUNC_PARAM_EXCELONLY } -#define C { FUNC_PARAM_CALCONLY } +#define RO { FuncParamValidity::Regular } +#define RA { FuncParamValidity::Regular } +#define RR { FuncParamValidity::Regular } +#define RX { FuncParamValidity::Regular } +#define VO { FuncParamValidity::Regular } +#define VV { FuncParamValidity::Regular } +#define VA { FuncParamValidity::Regular } +#define VR { FuncParamValidity::Regular } +#define VX { FuncParamValidity::Regular } +#define RO_E { FuncParamValidity::ExcelOnly } +#define VR_E { FuncParamValidity::ExcelOnly } +#define C { FuncParamValidity::CalcOnly } // Note: parameter types of all macro sheet functions (FUNCFLAG_MACROFUNC/FUNCFLAG_MACROCMD) untested! @@ -928,12 +928,12 @@ FunctionParamInfoIterator::FunctionParamInfoIterator( const FunctionInfo& rFuncI bool FunctionParamInfoIterator::isCalcOnlyParam() const { - return mpParamInfo && (mpParamInfo->meValid == FUNC_PARAM_CALCONLY); + return mpParamInfo && (mpParamInfo->meValid == FuncParamValidity::CalcOnly); } bool FunctionParamInfoIterator::isExcelOnlyParam() const { - return mpParamInfo && (mpParamInfo->meValid == FUNC_PARAM_EXCELONLY); + return mpParamInfo && (mpParamInfo->meValid == FuncParamValidity::ExcelOnly); } FunctionParamInfoIterator& FunctionParamInfoIterator::operator++() @@ -941,7 +941,7 @@ FunctionParamInfoIterator& FunctionParamInfoIterator::operator++() if( mpParamInfo ) { // move pointer to next entry, if something explicit follows - if( (mpParamInfo + 1 < mpParamInfoEnd) && (mpParamInfo[ 1 ].meValid != FUNC_PARAM_NONE) ) + if( mpParamInfo + 1 < mpParamInfoEnd ) ++mpParamInfo; // if last parameter type is 'Excel-only' or 'Calc-only', do not repeat it else if( isExcelOnlyParam() || isCalcOnlyParam() ) |