Renaming variables for upcoming commit for tdf#36737

... as discussed in https://gerrit.libreoffice.org/c/core/+/87550

Change-Id: I6262caf59751a2e0b6206f02aa1c7de55738a568
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89333
Tested-by: Mike Kaganski <mike.kaganski@collabora.com>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
This commit is contained in:
Andreas Heinisch
2020-02-24 11:15:09 +01:00
committed by Mike Kaganski
parent 8eea26e7c1
commit efa9ea101f

View File

@@ -4022,42 +4022,42 @@ void SbiRuntime::StepELEM( sal_uInt32 nOp1, sal_uInt32 nOp2 )
void SbiRuntime::StepPARAM( sal_uInt32 nOp1, sal_uInt32 nOp2 ) void SbiRuntime::StepPARAM( sal_uInt32 nOp1, sal_uInt32 nOp2 )
{ {
sal_uInt16 i = static_cast<sal_uInt16>( nOp1 & 0x7FFF ); sal_uInt16 nIdx = static_cast<sal_uInt16>( nOp1 & 0x7FFF );
SbxDataType t = static_cast<SbxDataType>(nOp2); SbxDataType eType = static_cast<SbxDataType>(nOp2);
SbxVariable* p; SbxVariable* pVar;
// #57915 solve missing in a cleaner way // #57915 solve missing in a cleaner way
sal_uInt32 nParamCount = refParams->Count32(); sal_uInt32 nParamCount = refParams->Count32();
if( i >= nParamCount ) if( nIdx >= nParamCount )
{ {
sal_uInt16 iLoop = i; sal_uInt16 iLoop = nIdx;
while( iLoop >= nParamCount ) while( iLoop >= nParamCount )
{ {
p = new SbxVariable(); pVar = new SbxVariable();
if( SbiRuntime::isVBAEnabled() && if( SbiRuntime::isVBAEnabled() &&
(t == SbxOBJECT || t == SbxSTRING) ) (eType == SbxOBJECT || eType == SbxSTRING) )
{ {
if( t == SbxOBJECT ) if( eType == SbxOBJECT )
{ {
p->PutObject( nullptr ); pVar->PutObject( nullptr );
} }
else else
{ {
p->PutString( OUString() ); pVar->PutString( OUString() );
} }
} }
else else
{ {
p->PutErr( 448 ); // like in VB: Error-Code 448 (ERRCODE_BASIC_NAMED_NOT_FOUND) pVar->PutErr( 448 ); // like in VB: Error-Code 448 (ERRCODE_BASIC_NAMED_NOT_FOUND)
} }
refParams->Put32( p, iLoop ); refParams->Put32( pVar, iLoop );
iLoop--; iLoop--;
} }
} }
p = refParams->Get32( i ); pVar = refParams->Get32( nIdx );
if( p->GetType() == SbxERROR && i ) if( pVar->GetType() == SbxERROR && nIdx )
{ {
// if there's a parameter missing, it can be OPTIONAL // if there's a parameter missing, it can be OPTIONAL
bool bOpt = false; bool bOpt = false;
@@ -4066,7 +4066,7 @@ void SbiRuntime::StepPARAM( sal_uInt32 nOp1, sal_uInt32 nOp2 )
SbxInfo* pInfo = pMeth->GetInfo(); SbxInfo* pInfo = pMeth->GetInfo();
if ( pInfo ) if ( pInfo )
{ {
const SbxParamInfo* pParam = pInfo->GetParam( i ); const SbxParamInfo* pParam = pInfo->GetParam( nIdx );
if( pParam && ( pParam->nFlags & SbxFlagBits::Optional ) ) if( pParam && ( pParam->nFlags & SbxFlagBits::Optional ) )
{ {
// Default value? // Default value?
@@ -4074,9 +4074,9 @@ void SbiRuntime::StepPARAM( sal_uInt32 nOp1, sal_uInt32 nOp2 )
if( nDefaultId > 0 ) if( nDefaultId > 0 )
{ {
OUString aDefaultStr = pImg->GetString( nDefaultId ); OUString aDefaultStr = pImg->GetString( nDefaultId );
p = new SbxVariable(pParam-> eType); pVar = new SbxVariable(pParam-> eType);
p->PutString( aDefaultStr ); pVar->PutString( aDefaultStr );
refParams->Put32( p, i ); refParams->Put32( pVar, nIdx );
} }
bOpt = true; bOpt = true;
} }
@@ -4087,19 +4087,19 @@ void SbiRuntime::StepPARAM( sal_uInt32 nOp1, sal_uInt32 nOp2 )
Error( ERRCODE_BASIC_NOT_OPTIONAL ); Error( ERRCODE_BASIC_NOT_OPTIONAL );
} }
} }
else if( t != SbxVARIANT && static_cast<SbxDataType>(p->GetType() & 0x0FFF ) != t ) else if( eType != SbxVARIANT && static_cast<SbxDataType>(pVar->GetType() & 0x0FFF ) != eType )
{ {
SbxVariable* q = new SbxVariable( t ); SbxVariable* q = new SbxVariable( eType );
aRefSaved.emplace_back(q ); aRefSaved.emplace_back(q );
*q = *p; *q = *pVar;
p = q; pVar = q;
if ( i ) if ( nIdx )
{ {
refParams->Put32( p, i ); refParams->Put32( pVar, nIdx );
} }
} }
SetupArgs( p, nOp1 ); SetupArgs( pVar, nOp1 );
PushVar( CheckArray( p ) ); PushVar( CheckArray( pVar ) );
} }
// Case-Test (+True-Target+Test-Opcode) // Case-Test (+True-Target+Test-Opcode)