Kaydet (Commit) 04004cc2 authored tarafından Noel Grandin's avatar Noel Grandin

convert FuncParamValidity to scoped enum

and drop unused NONE enumerator

Change-Id: Ibc77390efb195a9158ba809ad96aab4dcdbc09cb
üst f4ae7da0
...@@ -112,6 +112,7 @@ for d in definitionSet: ...@@ -112,6 +112,7 @@ for d in definitionSet:
"include/svtools/rtftoken.h", # RTF_TOKEN_IDS "include/svtools/rtftoken.h", # RTF_TOKEN_IDS
"starmath/source/mathtype.hxx", # MathType::MTOKENS "starmath/source/mathtype.hxx", # MathType::MTOKENS
"sd/source/filter/eppt/epptbase.hxx", # PPTExTextAttr "sd/source/filter/eppt/epptbase.hxx", # PPTExTextAttr
"sc/source/filter/inc/tokstack.hxx", # E_TYPE
# unit test code # unit test code
"cppu/source/uno/check.cxx", "cppu/source/uno/check.cxx",
# general weird nonsense going on # general weird nonsense going on
......
...@@ -367,12 +367,11 @@ struct ApiOpCodes ...@@ -367,12 +367,11 @@ struct ApiOpCodes
// Function parameter info ==================================================== // Function parameter info ====================================================
/** Enumerates validity modes for a function parameter. */ /** 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. Regular, /// Parameter supported by Calc and Excel.
FUNC_PARAM_REGULAR, /// Parameter supported by Calc and Excel. CalcOnly, /// Parameter supported by Calc only.
FUNC_PARAM_CALCONLY, /// Parameter supported by Calc only. ExcelOnly /// Parameter supported by Excel only.
FUNC_PARAM_EXCELONLY /// Parameter supported by Excel only.
}; };
/** Structure that contains all needed information for a parameter in a /** Structure that contains all needed information for a parameter in a
...@@ -474,7 +473,7 @@ enum FunctionLibraryType ...@@ -474,7 +473,7 @@ enum FunctionLibraryType
The member mpParamInfos points to a C-array of type information structures The member mpParamInfos points to a C-array of type information structures
for all parameters of the function. The last initialized structure 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 this array is used repeatedly for all following parameters supported by a
function. function.
*/ */
......
...@@ -203,18 +203,18 @@ const sal_uInt8 V = BIFF_TOKCLASS_VAL; ...@@ -203,18 +203,18 @@ const sal_uInt8 V = BIFF_TOKCLASS_VAL;
const sal_uInt8 A = BIFF_TOKCLASS_ARR; const sal_uInt8 A = BIFF_TOKCLASS_ARR;
// abbreviations for parameter infos // abbreviations for parameter infos
#define RO { FUNC_PARAM_REGULAR } #define RO { FuncParamValidity::Regular }
#define RA { FUNC_PARAM_REGULAR } #define RA { FuncParamValidity::Regular }
#define RR { FUNC_PARAM_REGULAR } #define RR { FuncParamValidity::Regular }
#define RX { FUNC_PARAM_REGULAR } #define RX { FuncParamValidity::Regular }
#define VO { FUNC_PARAM_REGULAR } #define VO { FuncParamValidity::Regular }
#define VV { FUNC_PARAM_REGULAR } #define VV { FuncParamValidity::Regular }
#define VA { FUNC_PARAM_REGULAR } #define VA { FuncParamValidity::Regular }
#define VR { FUNC_PARAM_REGULAR } #define VR { FuncParamValidity::Regular }
#define VX { FUNC_PARAM_REGULAR } #define VX { FuncParamValidity::Regular }
#define RO_E { FUNC_PARAM_EXCELONLY } #define RO_E { FuncParamValidity::ExcelOnly }
#define VR_E { FUNC_PARAM_EXCELONLY } #define VR_E { FuncParamValidity::ExcelOnly }
#define C { FUNC_PARAM_CALCONLY } #define C { FuncParamValidity::CalcOnly }
// Note: parameter types of all macro sheet functions (FUNCFLAG_MACROFUNC/FUNCFLAG_MACROCMD) untested! // Note: parameter types of all macro sheet functions (FUNCFLAG_MACROFUNC/FUNCFLAG_MACROCMD) untested!
...@@ -928,12 +928,12 @@ FunctionParamInfoIterator::FunctionParamInfoIterator( const FunctionInfo& rFuncI ...@@ -928,12 +928,12 @@ FunctionParamInfoIterator::FunctionParamInfoIterator( const FunctionInfo& rFuncI
bool FunctionParamInfoIterator::isCalcOnlyParam() const bool FunctionParamInfoIterator::isCalcOnlyParam() const
{ {
return mpParamInfo && (mpParamInfo->meValid == FUNC_PARAM_CALCONLY); return mpParamInfo && (mpParamInfo->meValid == FuncParamValidity::CalcOnly);
} }
bool FunctionParamInfoIterator::isExcelOnlyParam() const bool FunctionParamInfoIterator::isExcelOnlyParam() const
{ {
return mpParamInfo && (mpParamInfo->meValid == FUNC_PARAM_EXCELONLY); return mpParamInfo && (mpParamInfo->meValid == FuncParamValidity::ExcelOnly);
} }
FunctionParamInfoIterator& FunctionParamInfoIterator::operator++() FunctionParamInfoIterator& FunctionParamInfoIterator::operator++()
...@@ -941,7 +941,7 @@ FunctionParamInfoIterator& FunctionParamInfoIterator::operator++() ...@@ -941,7 +941,7 @@ FunctionParamInfoIterator& FunctionParamInfoIterator::operator++()
if( mpParamInfo ) if( mpParamInfo )
{ {
// move pointer to next entry, if something explicit follows // move pointer to next entry, if something explicit follows
if( (mpParamInfo + 1 < mpParamInfoEnd) && (mpParamInfo[ 1 ].meValid != FUNC_PARAM_NONE) ) if( mpParamInfo + 1 < mpParamInfoEnd )
++mpParamInfo; ++mpParamInfo;
// if last parameter type is 'Excel-only' or 'Calc-only', do not repeat it // if last parameter type is 'Excel-only' or 'Calc-only', do not repeat it
else if( isExcelOnlyParam() || isCalcOnlyParam() ) else if( isExcelOnlyParam() || isCalcOnlyParam() )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment