diff options
Diffstat (limited to 'sfx2/source/doc/objmisc.cxx')
-rwxr-xr-x | sfx2/source/doc/objmisc.cxx | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx index 343f880581..e5c6c31e7d 100755 --- a/sfx2/source/doc/objmisc.cxx +++ b/sfx2/source/doc/objmisc.cxx @@ -1710,7 +1710,7 @@ namespace } ErrCode SfxObjectShell::CallXScript( const Reference< XInterface >& _rxScriptContext, const ::rtl::OUString& _rScriptURL, - const Sequence< Any >& aParams, Any& aRet, Sequence< sal_Int16 >& aOutParamIndex, Sequence< Any >& aOutParam, bool bRaiseError ) + const Sequence< Any >& aParams, Any& aRet, Sequence< sal_Int16 >& aOutParamIndex, Sequence< Any >& aOutParam, bool bRaiseError, const ::com::sun::star::uno::Any* pCaller ) { OSL_TRACE( "in CallXScript" ); ErrCode nErr = ERRCODE_NONE; @@ -1741,7 +1741,16 @@ ErrCode SfxObjectShell::CallXScript( const Reference< XInterface >& _rxScriptCon // obtain the script, and execute it Reference< provider::XScript > xScript( xScriptProvider->getScript( _rScriptURL ), UNO_QUERY_THROW ); - + if ( pCaller && pCaller->hasValue() ) + { + Reference< beans::XPropertySet > xProps( xScript, uno::UNO_QUERY ); + if ( xProps.is() ) + { + Sequence< uno::Any > aArgs( 1 ); + aArgs[ 0 ] = *pCaller; + xProps->setPropertyValue( rtl::OUString::createFromAscii("Caller"), uno::makeAny( aArgs ) ); + } + } aRet = xScript->invoke( aParams, aOutParamIndex, aOutParam ); } catch ( const uno::Exception& ) @@ -1774,10 +1783,10 @@ ErrCode SfxObjectShell::CallXScript( const String& rScriptURL, aParams, ::com::sun::star::uno::Any& aRet, ::com::sun::star::uno::Sequence< sal_Int16 >& aOutParamIndex, - ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aOutParam - , bool bRaiseError ) + ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& + aOutParam, bool bRaiseError, const ::com::sun::star::uno::Any* pCaller ) { - return CallXScript( GetModel(), rScriptURL, aParams, aRet, aOutParamIndex, aOutParam, bRaiseError ); + return CallXScript( GetModel(), rScriptURL, aParams, aRet, aOutParamIndex, aOutParam, bRaiseError, pCaller ); } //------------------------------------------------------------------------- |