pVar != null, so static_cast(pVar) != null
Change-Id: Id22808858b5884b2f87064b389eb411e0712bab4 Reviewed-on: https://gerrit.libreoffice.org/18881 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
This commit is contained in:
@@ -150,32 +150,30 @@ SbiParser::SbiParser( StarBASIC* pb, SbModule* pm )
|
||||
}
|
||||
|
||||
// part of the runtime-library?
|
||||
SbiSymDef* SbiParser::CheckRTLForSym( const OUString& rSym, SbxDataType eType )
|
||||
SbiSymDef* SbiParser::CheckRTLForSym(const OUString& rSym, SbxDataType eType)
|
||||
{
|
||||
SbxVariable* pVar = GetBasic()->GetRtl()->Find( rSym, SbxCLASS_DONTCARE );
|
||||
SbiSymDef* pDef = NULL;
|
||||
if( pVar )
|
||||
SbxVariable* pVar = GetBasic()->GetRtl()->Find(rSym, SbxCLASS_DONTCARE);
|
||||
if (!pVar)
|
||||
return nullptr;
|
||||
|
||||
if (pVar->IsA(TYPE(SbxMethod)))
|
||||
{
|
||||
if( pVar->IsA( TYPE(SbxMethod) ) )
|
||||
SbiProcDef* pProc_ = aRtlSyms.AddProc( rSym );
|
||||
SbxMethod* pMethod = static_cast<SbxMethod*>(pVar);
|
||||
if (pMethod->IsRuntimeFunction())
|
||||
{
|
||||
SbiProcDef* pProc_ = aRtlSyms.AddProc( rSym );
|
||||
SbxMethod* pMethod = static_cast<SbxMethod*>(pVar);
|
||||
if ( pMethod && pMethod->IsRuntimeFunction() )
|
||||
{
|
||||
pProc_->SetType( pMethod->GetRuntimeFunctionReturnType() );
|
||||
}
|
||||
else
|
||||
{
|
||||
pProc_->SetType( pVar->GetType() );
|
||||
}
|
||||
pDef = pProc_;
|
||||
pProc_->SetType( pMethod->GetRuntimeFunctionReturnType() );
|
||||
}
|
||||
else
|
||||
{
|
||||
pDef = aRtlSyms.AddSym( rSym );
|
||||
pDef->SetType( eType );
|
||||
pProc_->SetType( pVar->GetType() );
|
||||
}
|
||||
return pProc_;
|
||||
}
|
||||
|
||||
|
||||
SbiSymDef* pDef = aRtlSyms.AddSym(rSym);
|
||||
pDef->SetType(eType);
|
||||
return pDef;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user