[Libreoffice-commits] core.git: sc/inc sc/source
Noel Grandin
noel at peralex.com
Wed Oct 8 02:35:39 PDT 2014
sc/inc/callform.hxx | 2 +-
sc/source/core/data/funcdesc.cxx | 20 ++++++++++----------
sc/source/core/tool/adiasync.cxx | 8 ++++----
sc/source/core/tool/callform.cxx | 6 +++---
sc/source/core/tool/interpr4.cxx | 20 ++++++++++----------
sc/source/core/tool/parclass.cxx | 4 ++--
6 files changed, 30 insertions(+), 30 deletions(-)
New commits:
commit 0c57f31a8b15ec0e84d1e3752122664af236a8c3
Author: Noel Grandin <noel at peralex.com>
Date: Wed Oct 8 10:00:07 2014 +0200
convert ParamType enum in SC to enum class
mostly to get the NONE constant out of the global namespace, so I can
convert other enums which also want to use the NONE constant
Change-Id: I988d5d7e5316dd5e4ca0be0cc8f043f69bbb900c
Reviewed-on: https://gerrit.libreoffice.org/11848
Reviewed-by: Noel Grandin <noelgrandin at gmail.com>
Tested-by: Noel Grandin <noelgrandin at gmail.com>
diff --git a/sc/inc/callform.hxx b/sc/inc/callform.hxx
index e66c4d0..8e19572 100644
--- a/sc/inc/callform.hxx
+++ b/sc/inc/callform.hxx
@@ -37,7 +37,7 @@ extern "C" {
typedef void (CALLTYPE* AdvData)( double& nHandle, void* pData );
}
-enum ParamType
+enum class ParamType
{
PTR_DOUBLE,
PTR_STRING,
diff --git a/sc/source/core/data/funcdesc.cxx b/sc/source/core/data/funcdesc.cxx
index 7ab1b47..b871c6a 100644
--- a/sc/source/core/data/funcdesc.cxx
+++ b/sc/source/core/data/funcdesc.cxx
@@ -483,19 +483,19 @@ ScFunctionList::ScFunctionList() :
{
switch (pAddInFuncData->GetParamType(j+1))
{
- case PTR_DOUBLE:
+ case ParamType::PTR_DOUBLE:
pDesc->maDefArgNames[j] = aDefArgNameValue;
break;
- case PTR_STRING:
+ case ParamType::PTR_STRING:
pDesc->maDefArgNames[j] = aDefArgNameString;
break;
- case PTR_DOUBLE_ARR:
+ case ParamType::PTR_DOUBLE_ARR:
pDesc->maDefArgNames[j] = aDefArgNameValues;
break;
- case PTR_STRING_ARR:
+ case ParamType::PTR_STRING_ARR:
pDesc->maDefArgNames[j] = aDefArgNameStrings;
break;
- case PTR_CELL_ARR:
+ case ParamType::PTR_CELL_ARR:
pDesc->maDefArgNames[j] = aDefArgNameCells;
break;
default:
@@ -509,19 +509,19 @@ ScFunctionList::ScFunctionList() :
{
switch (pAddInFuncData->GetParamType(j+1))
{
- case PTR_DOUBLE:
+ case ParamType::PTR_DOUBLE:
pDesc->maDefArgDescs[j] = aDefArgDescValue;
break;
- case PTR_STRING:
+ case ParamType::PTR_STRING:
pDesc->maDefArgDescs[j] = aDefArgDescString;
break;
- case PTR_DOUBLE_ARR:
+ case ParamType::PTR_DOUBLE_ARR:
pDesc->maDefArgDescs[j] = aDefArgDescValues;
break;
- case PTR_STRING_ARR:
+ case ParamType::PTR_STRING_ARR:
pDesc->maDefArgDescs[j] = aDefArgDescStrings;
break;
- case PTR_CELL_ARR:
+ case ParamType::PTR_CELL_ARR:
pDesc->maDefArgDescs[j] = aDefArgDescCells;
break;
default:
diff --git a/sc/source/core/tool/adiasync.cxx b/sc/source/core/tool/adiasync.cxx
index 727ae42..512d3cd 100644
--- a/sc/source/core/tool/adiasync.cxx
+++ b/sc/source/core/tool/adiasync.cxx
@@ -41,7 +41,7 @@ ScAddInAsync::ScAddInAsync() :
pDocs( NULL ),
mpFuncData( NULL ),
nHandle( 0 ),
- meType( NONE ),
+ meType( ParamType::NONE ),
bValid( false )
{ // nur fuer aSeekObj !
}
@@ -66,7 +66,7 @@ ScAddInAsync::~ScAddInAsync()
{
// in dTor because of theAddInAsyncTbl.DeleteAndDestroy in ScGlobal::Clear
mpFuncData->Unadvice( (double)nHandle );
- if ( meType == PTR_STRING && pStr ) // include type comparison because of union
+ if ( meType == ParamType::PTR_STRING && pStr ) // include type comparison because of union
delete pStr;
delete pDocs;
}
@@ -98,10 +98,10 @@ void ScAddInAsync::CallBack( sal_uLong nHandleP, void* pData )
}
switch ( p->meType )
{
- case PTR_DOUBLE :
+ case ParamType::PTR_DOUBLE :
p->nVal = *(double*)pData;
break;
- case PTR_STRING :
+ case ParamType::PTR_STRING :
{
sal_Char* pChar = (sal_Char*)pData;
if ( p->pStr )
diff --git a/sc/source/core/tool/callform.cxx b/sc/source/core/tool/callform.cxx
index a4e6076..479e0d9 100644
--- a/sc/source/core/tool/callform.cxx
+++ b/sc/source/core/tool/callform.cxx
@@ -206,21 +206,21 @@ bool InitExternalFunc(const OUString& rModuleName)
sal_Char cInternalName[256];
sal_uInt16 nParamCount;
ParamType eParamType[MAXFUNCPARAM];
- ParamType eAsyncType = NONE;
+ ParamType eAsyncType = ParamType::NONE;
// initialize all, in case the AddIn behaves bad
cFuncName[0] = 0;
cInternalName[0] = 0;
nParamCount = 0;
for ( sal_uInt16 j=0; j<MAXFUNCPARAM; j++ )
{
- eParamType[j] = NONE;
+ eParamType[j] = ParamType::NONE;
}
(*((GetFuncDataPtr)fpGetData))(i, cFuncName, nParamCount,
eParamType, cInternalName);
if( fpIsAsync )
{
(*((IsAsync)fpIsAsync))(i, &eAsyncType);
- if ( fpAdvice && eAsyncType != NONE )
+ if ( fpAdvice && eAsyncType != ParamType::NONE )
(*((Advice)fpAdvice))( i, pfCallBack );
}
OUString aInternalName( cInternalName, strlen(cInternalName), osl_getThreadTextEncoding() );
diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx
index 7909202..710b4a0 100644
--- a/sc/source/core/tool/interpr4.cxx
+++ b/sc/source/core/tool/interpr4.cxx
@@ -2492,13 +2492,13 @@ void ScInterpreter::ScExternal()
{
switch (eParamType[i])
{
- case PTR_DOUBLE :
+ case ParamType::PTR_DOUBLE :
{
nVal[i-1] = GetDouble();
ppParam[i] = &nVal[i-1];
}
break;
- case PTR_STRING :
+ case ParamType::PTR_STRING :
{
OString aStr(OUStringToOString(GetString().getString(),
osl_getThreadTextEncoding()));
@@ -2513,7 +2513,7 @@ void ScInterpreter::ScExternal()
}
}
break;
- case PTR_DOUBLE_ARR :
+ case ParamType::PTR_DOUBLE_ARR :
{
SCCOL nCol1;
SCROW nRow1;
@@ -2529,7 +2529,7 @@ void ScInterpreter::ScExternal()
ppParam[i] = pCellArr[i-1];
}
break;
- case PTR_STRING_ARR :
+ case ParamType::PTR_STRING_ARR :
{
SCCOL nCol1;
SCROW nRow1;
@@ -2545,7 +2545,7 @@ void ScInterpreter::ScExternal()
ppParam[i] = pCellArr[i-1];
}
break;
- case PTR_CELL_ARR :
+ case ParamType::PTR_CELL_ARR :
{
SCCOL nCol1;
SCROW nRow1;
@@ -2571,11 +2571,11 @@ void ScInterpreter::ScExternal()
if (nGlobalError == 0)
{
- if ( pFuncData->GetAsyncType() == NONE )
+ if ( pFuncData->GetAsyncType() == ParamType::NONE )
{
switch ( eParamType[0] )
{
- case PTR_DOUBLE :
+ case ParamType::PTR_DOUBLE :
{
double nErg = 0.0;
ppParam[0] = &nErg;
@@ -2583,7 +2583,7 @@ void ScInterpreter::ScExternal()
PushDouble(nErg);
}
break;
- case PTR_STRING :
+ case ParamType::PTR_STRING :
{
boost::scoped_array<sal_Char> pcErg(new sal_Char[ADDIN_MAXSTRLEN]);
ppParam[0] = pcErg.get();
@@ -2627,10 +2627,10 @@ void ScInterpreter::ScExternal()
{
switch ( pAs->GetType() )
{
- case PTR_DOUBLE :
+ case ParamType::PTR_DOUBLE :
PushDouble( pAs->GetValue() );
break;
- case PTR_STRING :
+ case ParamType::PTR_STRING :
PushString( pAs->GetString() );
break;
default:
diff --git a/sc/source/core/tool/parclass.cxx b/sc/source/core/tool/parclass.cxx
index 040da29..a397e79 100644
--- a/sc/source/core/tool/parclass.cxx
+++ b/sc/source/core/tool/parclass.cxx
@@ -361,8 +361,8 @@ ScParameterClassification::GetExternalParameterType( const formula::FormulaToken
{
switch ( pFuncData->GetParamType( nParameter) )
{
- case PTR_DOUBLE:
- case PTR_STRING:
+ case ParamType::PTR_DOUBLE:
+ case ParamType::PTR_STRING:
eRet = Value;
break;
default:
More information about the Libreoffice-commits
mailing list