[Libreoffice-commits] core.git: 2 commits - basic/source
Eike Rathke
erack at redhat.com
Tue Dec 5 19:08:56 UTC 2017
basic/source/runtime/methods.cxx | 20 +++++---------------
1 file changed, 5 insertions(+), 15 deletions(-)
New commits:
commit ef6940a48097fee287a7d8782a6a208292f6926c
Author: Eike Rathke <erack at redhat.com>
Date: Tue Dec 5 19:59:09 2017 +0100
Save an unnecessary duplicate GetObject() call
Change-Id: Ib0efc84ad2cedc1a149fa57996bc0481bd64591b
diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx
index 2e8c0d4f2ca9..542c8817700c 100644
--- a/basic/source/runtime/methods.cxx
+++ b/basic/source/runtime/methods.cxx
@@ -3608,8 +3608,8 @@ OUString getObjectTypeName( SbxVariable* pVar )
OUString sRet( "Object" );
if ( pVar )
{
- SbxBase* pObj = pVar->GetObject();
- if( !pObj )
+ SbxBase* pBaseObj = pVar->GetObject();
+ if( !pBaseObj )
{
sRet = "Nothing";
}
@@ -3618,10 +3618,7 @@ OUString getObjectTypeName( SbxVariable* pVar )
SbUnoObject* pUnoObj = dynamic_cast<SbUnoObject*>( pVar );
if ( !pUnoObj )
{
- if ( SbxBase* pBaseObj = pVar->GetObject() )
- {
- pUnoObj = dynamic_cast<SbUnoObject*>( pBaseObj );
- }
+ pUnoObj = dynamic_cast<SbUnoObject*>( pBaseObj );
}
if ( pUnoObj )
{
commit 36493607d8da6a5caf4b73813ddbbf8dc1d7d895
Author: Eike Rathke <erack at redhat.com>
Date: Tue Dec 5 18:30:12 2017 +0100
Simplify the IsObject()/GetObject() logic here
Change-Id: I816b15b6795b4946b1bfed0d1f6d103a6a1aba4f
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 );
}
}
More information about the Libreoffice-commits
mailing list