summaryrefslogtreecommitdiff
path: root/basic/source/runtime/step0.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'basic/source/runtime/step0.cxx')
-rw-r--r--basic/source/runtime/step0.cxx37
1 files changed, 37 insertions, 0 deletions
diff --git a/basic/source/runtime/step0.cxx b/basic/source/runtime/step0.cxx
index 39af5ea4adc3..1d9333ff7555 100644
--- a/basic/source/runtime/step0.cxx
+++ b/basic/source/runtime/step0.cxx
@@ -43,6 +43,9 @@
#include <vcl/svapp.hxx>
#include <unotools/textsearch.hxx>
+Reference< XInterface > createComListener( const Any& aControlAny, const ::rtl::OUString& aVBAType,
+ const ::rtl::OUString& aPrefix, SbxObjectRef xScopeObj );
+
#include <algorithm>
SbxVariable* getDefaultProp( SbxVariable* pRef );
@@ -515,8 +518,29 @@ void SbiRuntime::StepSET_Impl( SbxVariableRef& refVal, SbxVariableRef& refVar, b
}
}
+ // Handle withevents
+ BOOL bWithEvents = refVar->IsSet( SBX_WITH_EVENTS );
+ Reference< XInterface > xComListener;
+ if( bWithEvents )
+ {
+ SbxBase* pObj = refVal->GetObject();
+ SbUnoObject* pUnoObj = (pObj != NULL) ? PTR_CAST(SbUnoObject,pObj) : NULL;
+ if( pUnoObj != NULL )
+ {
+ Any aControlAny = pUnoObj->getUnoAny();
+ String aDeclareClassName = refVar->GetDeclareClassName();
+ ::rtl::OUString aVBAType = aDeclareClassName;
+ ::rtl::OUString aPrefix = refVar->GetName();
+ SbxObjectRef xScopeObj = refVar->GetParent();
+ xComListener = createComListener( aControlAny, aVBAType, aPrefix, xScopeObj );
+ }
+ }
+
*refVar = *refVal;
+ if( bWithEvents )
+ refVar->SetComListener( xComListener ); // Hold reference
+
// lhs is a property who's value is currently (Empty e.g. no broadcast yet)
// in this case if there is a default prop involved the value of the
// default property may infact be void so the type will also be SbxEMPTY
@@ -908,6 +932,19 @@ void SbiRuntime::StepARRAYACCESS()
PushVar( CheckArray( refVar ) );
}
+void SbiRuntime::StepBYVAL()
+{
+ // Copy variable on stack to break call by reference
+ SbxVariableRef pVar = PopVar();
+ SbxDataType t = pVar->GetType();
+
+ SbxVariable* pCopyVar = new SbxVariable( t );
+ pCopyVar->SetFlag( SBX_READWRITE );
+ *pCopyVar = *pVar;
+
+ PushVar( pCopyVar );
+}
+
// Einrichten eines Argvs
// nOp1 bleibt so -> 1. Element ist Returnwert