Kaydet (Commit) d1cd68fa authored tarafından Eike Rathke's avatar Eike Rathke

Rather call GetObject() only if IsObject(), tdf#112571 follow-up

Which effectively is what GetObject() internally also does to
determine whether to set an error, so resetting an error here is
moot (or might even hide a nested error?).

Change-Id: I8736d16e386d1833126965538f96aaa1fd73dfd6
üst ea4964ed
...@@ -2461,18 +2461,10 @@ void SbRtl_IsError(StarBASIC *, SbxArray & rPar, bool) ...@@ -2461,18 +2461,10 @@ void SbRtl_IsError(StarBASIC *, SbxArray & rPar, bool)
SbUnoObject* pObj = dynamic_cast<SbUnoObject*>( pVar ); SbUnoObject* pObj = dynamic_cast<SbUnoObject*>( pVar );
if ( !pObj ) if ( !pObj )
{ {
// GetObject() sets error if the variable was not an object, so if ( SbxBase* pBaseObj = (pVar->IsObject() ? pVar->GetObject() : nullptr) )
// remember and reset if it isn't.
ErrCode eOld = SbxBase::GetError();
if ( SbxBase* pBaseObj = pVar->GetObject() )
{ {
pObj = dynamic_cast<SbUnoObject*>( pBaseObj ); pObj = dynamic_cast<SbUnoObject*>( pBaseObj );
} }
else
{
SbxBase::ResetError();
SbxBase::SetError( eOld );
}
} }
uno::Reference< script::XErrorQuery > xError; uno::Reference< script::XErrorQuery > xError;
if ( pObj ) if ( pObj )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment