diff options
author | Oliver Bolte <obo@openoffice.org> | 2004-11-15 12:28:41 +0000 |
---|---|---|
committer | Oliver Bolte <obo@openoffice.org> | 2004-11-15 12:28:41 +0000 |
commit | 38c34ed6c670251a1319b82d75e807fa288fcdeb (patch) | |
tree | f1a7dcb116cc9103f7e0984cbcf58f80940418c4 /basic | |
parent | 29d269c2b9d38cdbbc58b6b1809f0c8468d05577 (diff) |
INTEGRATION: CWS tbe13 (1.18.86); FILE MERGED
2004/11/08 11:48:15 tbe 1.18.86.4: #i30434# Euro Converter is unusable
2004/11/05 11:14:13 tbe 1.18.86.3: #i30434# Euro Converter is unusable
2004/11/05 09:40:07 tbe 1.18.86.2: RESYNC: (1.18-1.19); FILE MERGED
2004/09/28 14:59:13 tbe 1.18.86.1: #i30434# Euro Converter is unusable
Diffstat (limited to 'basic')
-rw-r--r-- | basic/source/classes/eventatt.cxx | 44 |
1 files changed, 32 insertions, 12 deletions
diff --git a/basic/source/classes/eventatt.cxx b/basic/source/classes/eventatt.cxx index 13fd3b33a453..479698123759 100644 --- a/basic/source/classes/eventatt.cxx +++ b/basic/source/classes/eventatt.cxx @@ -2,9 +2,9 @@ * * $RCSfile: eventatt.cxx,v $ * - * $Revision: 1.19 $ + * $Revision: 1.20 $ * - * last change: $Author: rt $ $Date: 2004-10-25 08:06:18 $ + * last change: $Author: obo $ $Date: 2004-11-15 13:28:41 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -107,6 +107,9 @@ #ifndef _COM_SUN_STAR_AWT_XWINDOW_HPP_ #include <com/sun/star/awt/XWindow.hpp> #endif +#ifndef _COM_SUN_STAR_SCRIPT_PROVIDER_XSCRIPTPROVIDERFACTORY_HPP_ +#include <com/sun/star/script/provider/XScriptProviderFactory.hpp> +#endif #include <com/sun/star/script/provider/XScriptProviderSupplier.hpp> #include <com/sun/star/script/provider/XScriptProvider.hpp> @@ -237,18 +240,35 @@ void SFURL_firing_impl( const ScriptEvent& aScriptEvent, Any* pRet, const Refere RTL_TEXTENCODING_ASCII_US ).pData->buffer ); try { - Reference< provider::XScriptProviderSupplier > xSPS = - Reference< provider::XScriptProviderSupplier > - ( xModel, UNO_QUERY ); - - if ( !xSPS.is() ) + Reference< provider::XScriptProvider > xScriptProvider; + if ( xModel.is() ) { - OSL_TRACE("SFURL_firing_impl(): Failed to get XScriptProvider"); - return; + Reference< provider::XScriptProviderSupplier > xSupplier( xModel, UNO_QUERY ); + OSL_ENSURE( xSupplier.is(), "SFURL_firing_impl: failed to get script provider supplier" ); + if ( xSupplier.is() ) + xScriptProvider.set( xSupplier->getScriptProvider() ); + } + else + { + Reference< XComponentContext > xContext; + Reference< XPropertySet > xProps( ::comphelper::getProcessServiceFactory(), UNO_QUERY ); + OSL_ASSERT( xProps.is() ); + OSL_VERIFY( xProps->getPropertyValue( ::rtl::OUString::createFromAscii( "DefaultContext" ) ) >>= xContext ); + if ( xContext.is() ) + { + Reference< provider::XScriptProviderFactory > xFactory( + xContext->getValueByName( + ::rtl::OUString::createFromAscii( "/singletons/com.sun.star.script.provider.theMasterScriptProviderFactory" ) ), + UNO_QUERY ); + OSL_ENSURE( xFactory.is(), "SFURL_firing_impl: failed to get master script provider factory" ); + if ( xFactory.is() ) + { + Any aCtx; + aCtx <<= ::rtl::OUString::createFromAscii( "user" ); + xScriptProvider.set( xFactory->createScriptProvider( aCtx ), UNO_QUERY ); + } + } } - - Reference< provider::XScriptProvider > xScriptProvider = - xSPS->getScriptProvider(); if ( !xScriptProvider.is() ) { |