diff options
author | Eike Rathke <erack@redhat.com> | 2017-12-05 18:30:12 +0100 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2017-12-05 18:30:22 +0100 |
commit | 36493607d8da6a5caf4b73813ddbbf8dc1d7d895 (patch) | |
tree | a6ddaf469ee701b7f6ec9281b728cb702b047fab /basic/source | |
parent | d1cd68fac3a3a521e1f7ebf033b908d67832a0c1 (diff) |
Simplify the IsObject()/GetObject() logic here
Change-Id: I816b15b6795b4946b1bfed0d1f6d103a6a1aba4f
Diffstat (limited to 'basic/source')
-rw-r--r-- | basic/source/runtime/methods.cxx | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx index 4a5aaa39a98b..2e8c0d4f2ca9 100644 --- a/basic/source/runtime/methods.cxx +++ b/basic/source/runtime/methods.cxx @@ -2371,21 +2371,14 @@ void SbRtl_IsObject(StarBASIC *, SbxArray & rPar, bool) else { SbxVariable* pVar = rPar.Get(1); - SbxBase* pObj = pVar->GetObject(); - - // #100385: GetObject can result in an error, so reset it - SbxBase::ResetError(); + bool bObject = pVar->IsObject(); + SbxBase* pObj = (bObject ? pVar->GetObject() : nullptr); SbUnoClass* pUnoClass; - bool bObject; if( pObj && ( pUnoClass=dynamic_cast<SbUnoClass*>( pObj) ) != nullptr ) { bObject = pUnoClass->getUnoClass().is(); } - else - { - bObject = pVar->IsObject(); - } rPar.Get( 0 )->PutBool( bObject ); } } |