summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorNorbert Thiebaud <nthiebaud@gmail.com>2012-11-03 09:07:25 -0500
committerNorbert Thiebaud <nthiebaud@gmail.com>2012-11-03 20:24:28 -0500
commitd92814f462432b52b1ef4d0dc335d22af881397b (patch)
treeb5d9c03dae16bc2b19ad36f2f3894f723b1b8231 /sc
parent4316e643ef345b0f673b4a03a80a4b7cb3185588 (diff)
basic: preliminary cosmetic clean-up
parsing 1000s of line of code is hard enough without having to fight with weird indentation and irregular formatting. So as the review progress, in order to follow the code, cosmetic changes were made... In order to minimize the task of the reviewers and allow them to concentrate on what matter, an effort is made to collect these cosmetic changes into this separate commit. Change-Id: I3c9b04a0150d0d0a048c2e976fe24de4f2b6b98a
Diffstat (limited to 'sc')
-rw-r--r--sc/source/core/tool/interpr4.cxx45
1 files changed, 42 insertions, 3 deletions
diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx
index 85856993ba7d..3dd661bc6848 100644
--- a/sc/source/core/tool/interpr4.cxx
+++ b/sc/source/core/tool/interpr4.cxx
@@ -2998,9 +2998,13 @@ void ScInterpreter::ScExternal()
uno::Reference<table::XCellRange> xObj =
ScCellRangeObj::CreateRangeFromDoc( pDok, aRange );
if (xObj.is())
+ {
aParam <<= xObj;
+ }
else
+ {
SetError(errIllegalParameter);
+ }
}
break;
default:
@@ -3017,8 +3021,9 @@ void ScInterpreter::ScExternal()
}
while (nPar-- > 0)
+ {
Pop(); // in case of error, remove remaining args
-
+ }
if ( !GetError() )
{
aCall.ExecuteCall();
@@ -3026,8 +3031,9 @@ void ScInterpreter::ScExternal()
if ( aCall.HasVarRes() ) // handle async functions
{
if ( pMyFormulaCell->GetCode()->IsRecalcModeNormal() )
+ {
pMyFormulaCell->GetCode()->SetRecalcModeOnLoad();
-
+ }
uno::Reference<sheet::XVolatileResult> xRes = aCall.GetVarRes();
ScAddInListener* pLis = ScAddInListener::Get( xRes );
if ( !pLis )
@@ -3039,23 +3045,31 @@ void ScInterpreter::ScExternal()
{
pMyFormulaCell->StartListening( *pLis );
if ( !pLis->HasDocument( pDok ) )
+ {
pLis->AddDocument( pDok );
+ }
}
aCall.SetResult( pLis->GetResult() ); // use result from async
}
if ( aCall.GetErrCode() )
+ {
PushError( aCall.GetErrCode() );
+ }
else if ( aCall.HasMatrix() )
{
ScMatrixRef xMat = aCall.GetMatrix();
PushMatrix( xMat );
}
else if ( aCall.HasString() )
+ {
PushString( aCall.GetString() );
+ }
else
+ {
PushDouble( aCall.GetValue() );
+ }
}
else // error...
PushError( GetError());
@@ -3063,7 +3077,9 @@ void ScInterpreter::ScExternal()
else
{
while( nParamCount-- > 0)
+ {
Pop();
+ }
PushError( errNoAddin );
}
}
@@ -3189,10 +3205,13 @@ void ScInterpreter::ScMacro()
aMacroStr += pMethod->GetName();
String aBasicStr;
if (pObject->GetParent())
+ {
aBasicStr = pObject->GetParent()->GetName(); // Dokumentenbasic
+ }
else
+ {
aBasicStr = SFX_APP()->GetName(); // Applikationsbasic
-
+ }
// Parameter-Array zusammenbauen
SbxArrayRef refPar = new SbxArray;
@@ -3219,7 +3238,9 @@ void ScInterpreter::ScMacro()
bOk = lcl_setVBARange( aRange, pDok, pPar );
}
else
+ {
bOk = SetSbxVariable( pPar, aAdr );
+ }
}
break;
case svDoubleRef:
@@ -3286,15 +3307,21 @@ void ScInterpreter::ScMacro()
nIdx[ 1 ] = static_cast<sal_Int32>(nMatCol+1);
SbxVariable* p = refArray->Get32( nIdx );
if (pMat->IsString(nMatCol, nMatRow))
+ {
p->PutString( pMat->GetString(nMatCol, nMatRow) );
+ }
else
+ {
p->PutDouble( pMat->GetDouble(nMatCol, nMatRow));
+ }
}
}
pPar->PutObject( refArray );
}
else
+ {
SetError( errIllegalParameter );
+ }
}
break;
default:
@@ -3320,11 +3347,17 @@ void ScInterpreter::ScMacro()
SbxDataType eResType = refRes->GetType();
if( pVar->GetError() )
+ {
SetError( errNoValue);
+ }
if ( eRet != ERRCODE_NONE )
+ {
PushNoValue();
+ }
else if( eResType >= SbxINTEGER && eResType <= SbxDOUBLE )
+ {
PushDouble( refRes->GetDouble() );
+ }
else if ( eResType & SbxARRAY )
{
SbxBase* pElemObj = refRes->GetObject();
@@ -3371,7 +3404,9 @@ void ScInterpreter::ScMacro()
pV = pDimArray->Get32( nIdx );
eType = pV->GetType();
if ( eType >= SbxINTEGER && eType <= SbxDOUBLE )
+ {
pMat->PutDouble( pV->GetDouble(), i, j );
+ }
else
pMat->PutString( pV->GetString(), i, j );
}
@@ -3379,10 +3414,14 @@ void ScInterpreter::ScMacro()
PushMatrix( pMat );
}
else
+ {
PushIllegalArgument();
+ }
}
else
+ {
PushNoValue();
+ }
}
else
PushString( refRes->GetString() );