summaryrefslogtreecommitdiff
path: root/basic/source/classes/eventatt.cxx
diff options
context:
space:
mode:
authorOliver Bolte <obo@openoffice.org>2004-11-15 12:28:41 +0000
committerOliver Bolte <obo@openoffice.org>2004-11-15 12:28:41 +0000
commitf0a9912ae7d9e27f889d8597abfef6b75f54b79b (patch)
tree6b42fdff91338de6543206dbb6d0791c1c002228 /basic/source/classes/eventatt.cxx
parentf7e455bc11cde220572a84bfeae01f0113a16098 (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/source/classes/eventatt.cxx')
-rw-r--r--basic/source/classes/eventatt.cxx44
1 files changed, 32 insertions, 12 deletions
diff --git a/basic/source/classes/eventatt.cxx b/basic/source/classes/eventatt.cxx
index 2999abd305..7fd0a67780 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() )
{