From e52beea63ddd7087c61df5838f9643d68486d71e Mon Sep 17 00:00:00 2001 From: Eike Rathke Date: Wed, 10 May 2017 12:26:19 +0200 Subject: GetParameterType: SAL_MAX_UINT16 for return ParamClass, tdf#107724 prep Change-Id: Idff1d247907494ffd50a0fcf0fc73344e381cc3c --- sc/source/core/inc/parclass.hxx | 4 +++- sc/source/core/tool/parclass.cxx | 9 +++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/sc/source/core/inc/parclass.hxx b/sc/source/core/inc/parclass.hxx index 18a4026679ae..06c5161a988d 100644 --- a/sc/source/core/inc/parclass.hxx +++ b/sc/source/core/inc/parclass.hxx @@ -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); diff --git a/sc/source/core/tool/parclass.cxx b/sc/source/core/tool/parclass.cxx index 17ef5b257d0b..fbd790ef4742 100644 --- a/sc/source/core/tool/parclass.cxx +++ b/sc/source/core/tool/parclass.cxx @@ -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()); { -- cgit