diff options
author | Eike Rathke <erack@redhat.com> | 2017-12-05 18:16:20 +0100 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2017-12-05 18:17:06 +0100 |
commit | d1cd68fac3a3a521e1f7ebf033b908d67832a0c1 (patch) | |
tree | f6f3235541f7934c230307e0ce2791f68948b69d /basic | |
parent | ea4964ed25d24f83b01628766d5908e1ff4a346b (diff) |
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
Diffstat (limited to 'basic')
-rw-r--r-- | basic/source/runtime/methods.cxx | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx index 161fa4887d48..4a5aaa39a98b 100644 --- a/basic/source/runtime/methods.cxx +++ b/basic/source/runtime/methods.cxx @@ -2461,18 +2461,10 @@ void SbRtl_IsError(StarBASIC *, SbxArray & rPar, bool) SbUnoObject* pObj = dynamic_cast<SbUnoObject*>( pVar ); if ( !pObj ) { - // GetObject() sets error if the variable was not an object, so - // remember and reset if it isn't. - ErrCode eOld = SbxBase::GetError(); - if ( SbxBase* pBaseObj = pVar->GetObject() ) + if ( SbxBase* pBaseObj = (pVar->IsObject() ? pVar->GetObject() : nullptr) ) { pObj = dynamic_cast<SbUnoObject*>( pBaseObj ); } - else - { - SbxBase::ResetError(); - SbxBase::SetError( eOld ); - } } uno::Reference< script::XErrorQuery > xError; if ( pObj ) |