[Libreoffice-commits] core.git: basic/source

Eike Rathke erack at redhat.com
Tue Dec 5 17:18:32 UTC 2017


 basic/source/runtime/methods.cxx |   10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

New commits:
commit d1cd68fac3a3a521e1f7ebf033b908d67832a0c1
Author: Eike Rathke <erack at redhat.com>
Date:   Tue Dec 5 18:16:20 2017 +0100

    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

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 )


More information about the Libreoffice-commits mailing list