diff options
author | Eike Rathke <erack@redhat.com> | 2017-05-10 12:26:19 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2017-05-10 14:00:31 +0200 |
commit | e52beea63ddd7087c61df5838f9643d68486d71e (patch) | |
tree | 76ce0330c57acd8a55b38650d0bfbb6c15c418b9 | |
parent | 656cf4d2e7c7d193d4d23900a344d6625fc217ac (diff) |
GetParameterType: SAL_MAX_UINT16 for return ParamClass, tdf#107724 prep
Change-Id: Idff1d247907494ffd50a0fcf0fc73344e381cc3c
-rw-r--r-- | sc/source/core/inc/parclass.hxx | 4 | ||||
-rw-r--r-- | 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()); { |