GetParameterType: SAL_MAX_UINT16 for return ParamClass, tdf#107724 prep

Change-Id: Idff1d247907494ffd50a0fcf0fc73344e381cc3c
This commit is contained in:
Eike Rathke
2017-05-10 12:26:19 +02:00
parent 656cf4d2e7
commit e52beea63d
2 changed files with 10 additions and 3 deletions

View File

@@ -42,7 +42,9 @@ public:
/** Get one parameter type for function eOp.
@param nParameter
Which parameter, 0-based */
Which parameter, 0-based.
SAL_MAX_UINT16 for return type of eOp.
*/
static formula::ParamClass GetParameterType( const formula::FormulaToken* pToken,
sal_uInt16 nParameter);

View File

@@ -324,7 +324,7 @@ formula::ParamClass ScParameterClassification::GetParameterType(
case ocExternal:
return GetExternalParameterType( pToken, nParameter);
case ocMacro:
return Reference;
return (nParameter == SAL_MAX_UINT16 ? Value : Reference);
default:
{
// added to avoid warnings
@@ -334,7 +334,9 @@ formula::ParamClass ScParameterClassification::GetParameterType(
{
sal_uInt8 nRepeat;
formula::ParamClass eType;
if ( nParameter < CommonData::nMaxParams )
if (nParameter == SAL_MAX_UINT16)
eType = pData[eOp].aData.eReturn;
else if ( nParameter < CommonData::nMaxParams )
eType = pData[eOp].aData.nParam[nParameter];
else if ( (nRepeat = pData[eOp].aData.nRepeatLast) > 0 )
{
@@ -357,6 +359,9 @@ formula::ParamClass ScParameterClassification::GetExternalParameterType( const f
sal_uInt16 nParameter)
{
formula::ParamClass eRet = Unknown;
if (nParameter == SAL_MAX_UINT16)
return eRet;
// similar to ScInterpreter::ScExternal()
OUString aFuncName = ScGlobal::pCharClass->uppercase( pToken->GetExternal());
{