diff options
Diffstat (limited to 'vbahelper/source/msforms/vbacontrol.cxx')
-rw-r--r-- | vbahelper/source/msforms/vbacontrol.cxx | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/vbahelper/source/msforms/vbacontrol.cxx b/vbahelper/source/msforms/vbacontrol.cxx index 516cfa69247a..ae0cc588cf17 100644 --- a/vbahelper/source/msforms/vbacontrol.cxx +++ b/vbahelper/source/msforms/vbacontrol.cxx @@ -519,8 +519,9 @@ ScVbaControl::setMousePointer( ::sal_Int32 _mousepointer ) throw (::com::sun::st } } -void ScVbaControl::fireEvent( script::ScriptEvent& evt ) +void SAL_CALL ScVbaControl::fireEvent( const script::ScriptEvent& rEvt ) throw (uno::RuntimeException) { + script::ScriptEvent evt( rEvt ); uno::Reference<lang::XMultiComponentFactory > xServiceManager( mxContext->getServiceManager(), uno::UNO_QUERY_THROW ); uno::Reference< script::XScriptListener > xScriptListener( xServiceManager->createInstanceWithContext( "ooo.vba.EventListener" , mxContext ), uno::UNO_QUERY_THROW ); @@ -546,7 +547,9 @@ void ScVbaControl::fireEvent( script::ScriptEvent& evt ) uno::Reference< document::XCodeNameQuery > xNameQuery( xDocFac->createInstance( "ooo.vba.VBACodeNameProvider" ), uno::UNO_QUERY_THROW ); uno::Reference< uno::XInterface > xIf( xControlShape->getControl(), uno::UNO_QUERY_THROW ); evt.ScriptCode = xNameQuery->getCodeNameForObject( xIf ); - evt.Arguments[ 0 ] = uno::makeAny( aEvt ); + // handle if we passed in our own arguments + if ( !rEvt.Arguments.getLength() ) + evt.Arguments[ 0 ] = uno::makeAny( aEvt ); xScriptListener->firing( evt ); } else |