summaryrefslogtreecommitdiff
path: root/basic/source/runtime/step1.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'basic/source/runtime/step1.cxx')
-rw-r--r--basic/source/runtime/step1.cxx23
1 files changed, 17 insertions, 6 deletions
diff --git a/basic/source/runtime/step1.cxx b/basic/source/runtime/step1.cxx
index f448f7900b..0a82b9af57 100644
--- a/basic/source/runtime/step1.cxx
+++ b/basic/source/runtime/step1.cxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -38,7 +38,7 @@
#include "sbunoobj.hxx"
#include "errobject.hxx"
-bool checkUnoObjectType( SbUnoObject* refVal,
+bool checkUnoObjectType( SbUnoObject* refVal,
const String& aClass );
// Laden einer numerischen Konstanten (+ID)
@@ -93,6 +93,15 @@ void SbiRuntime::StepARGN( UINT32 nOp1 )
{
String aAlias( pImg->GetString( static_cast<short>( nOp1 ) ) );
SbxVariableRef pVal = PopVar();
+ if( bVBAEnabled && ( pVal->ISA(SbxMethod) || pVal->ISA(SbUnoProperty) || pVal->ISA(SbProcedureProperty) ) )
+ {
+ // named variables ( that are Any especially properties ) can be empty at this point and need a broadcast
+ if ( pVal->GetType() == SbxEMPTY )
+ pVal->Broadcast( SBX_HINT_DATAWANTED );
+ // Methoden und Properties evaluieren!
+ SbxVariable* pRes = new SbxVariable( *pVal );
+ pVal = pRes;
+ }
refArgv->Put( pVal, nArgc );
refArgv->PutAlias( aAlias, nArgc++ );
}
@@ -160,7 +169,7 @@ void SbiRuntime::StepPAD( UINT32 nOp1 )
void SbiRuntime::StepJUMP( UINT32 nOp1 )
{
#ifdef DBG_UTIL
- // #QUESTION shouln't this be
+ // #QUESTION shouln't this be
// if( (BYTE*)( nOp1+pImagGetCode() ) >= pImg->GetCodeSize() )
if( nOp1 >= pImg->GetCodeSize() )
StarBASIC::FatalError( SbERR_INTERNAL_ERROR );
@@ -182,7 +191,9 @@ void SbiRuntime::StepJUMPT( UINT32 nOp1 )
void SbiRuntime::StepJUMPF( UINT32 nOp1 )
{
SbxVariableRef p = PopVar();
- if( !p->GetBool() )
+ // In a test e.g. If Null then
+ // will evaluate Null will act as if False
+ if( ( bVBAEnabled && p->IsNull() ) || !p->GetBool() )
StepJUMP( nOp1 );
}
@@ -443,7 +454,7 @@ bool SbiRuntime::implIsClass( SbxObject* pObj, const String& aClass )
SbClassData* pClassData;
if( pClassMod && (pClassData=pClassMod->pClassData) != NULL )
{
- SbxVariable* pClassVar =
+ SbxVariable* pClassVar =
pClassData->mxIfaces->Find( aClass, SbxCLASS_DONTCARE );
bRet = (pClassVar != NULL);
}
@@ -452,7 +463,7 @@ bool SbiRuntime::implIsClass( SbxObject* pObj, const String& aClass )
return bRet;
}
-bool SbiRuntime::checkClass_Impl( const SbxVariableRef& refVal,
+bool SbiRuntime::checkClass_Impl( const SbxVariableRef& refVal,
const String& aClass, bool bRaiseErrors, bool bDefault )
{
bool bOk = bDefault;