summaryrefslogtreecommitdiff
path: root/scripting
diff options
context:
space:
mode:
authorRüdiger Timm <rt@openoffice.org>2004-05-19 07:27:07 +0000
committerRüdiger Timm <rt@openoffice.org>2004-05-19 07:27:07 +0000
commit00078fc95782b6da7da71c5fcab762e6b18fefa9 (patch)
treec103c4142553db791381221fd1afec0c198aff01 /scripting
parentdb6cbe51779e8c104abb6fb0532e2fb47864a287 (diff)
INTEGRATION: CWS scriptingf4 (1.16.4); FILE MERGED
2004/05/11 10:08:57 toconnor 1.16.4.1: #i28888# - basic provider not executing script for Start Application event
Diffstat (limited to 'scripting')
-rw-r--r--scripting/source/protocolhandler/scripthandler.cxx32
1 files changed, 22 insertions, 10 deletions
diff --git a/scripting/source/protocolhandler/scripthandler.cxx b/scripting/source/protocolhandler/scripthandler.cxx
index 838acc798490..11442a20f99a 100644
--- a/scripting/source/protocolhandler/scripthandler.cxx
+++ b/scripting/source/protocolhandler/scripthandler.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: scripthandler.cxx,v $
*
-* $Revision: 1.16 $
+* $Revision: 1.17 $
*
-* last change: $Author: svesik $ $Date: 2004-04-19 23:15:53 $
+* last change: $Author: rt $ $Date: 2004-05-19 08:27:07 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -73,6 +73,7 @@
#include <com/sun/star/lang/XSingleServiceFactory.hpp>
#include <drafts/com/sun/star/script/provider/XScriptProviderSupplier.hpp>
+#include <drafts/com/sun/star/script/provider/XScriptProviderFactory.hpp>
#include <sfx2/objsh.hxx>
#include <sfx2/frame.hxx>
@@ -84,6 +85,7 @@
#include "com/sun/star/uri/XUriReference.hpp"
#include "com/sun/star/uri/XUriReferenceFactory.hpp"
#include "com/sun/star/uri/XVndSunStarScriptUrl.hpp"
+#include "com/sun/star/beans/XPropertySet.hpp"
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
@@ -409,14 +411,24 @@ throw ( RuntimeException )
if ( !m_xScriptProvider.is() )
{
- OSL_TRACE("GOT NO FRAME, create empty MSP");
- // Create a MasterScriptProvider using m_xFactory
- ::rtl::OUString serviceName =
- ::rtl::OUString::createFromAscii(
- "drafts.com.sun.star.script.provider.MasterScriptProvider" );
-
- m_xScriptProvider = Reference< provider::XScriptProvider >
- ( m_xFactory->createInstance( serviceName ), UNO_QUERY_THROW );
+ Reference< XPropertySet > xProps( m_xFactory, UNO_QUERY_THROW );
+
+ ::rtl::OUString dc(
+ RTL_CONSTASCII_USTRINGPARAM( "DefaultContext" ) );
+
+ Reference< XComponentContext > xCtx(
+ xProps->getPropertyValue( dc ), UNO_QUERY_THROW );
+
+ ::rtl::OUString tmspf = ::rtl::OUString::createFromAscii(
+ "/singletons/drafts.com.sun.star.script.provider.theMasterScriptProviderFactory");
+
+ Reference< provider::XScriptProviderFactory > xFac(
+ xCtx->getValueByName( tmspf ), UNO_QUERY_THROW );
+
+ Any aContext;
+
+ m_xScriptProvider = Reference< provider::XScriptProvider > (
+ xFac->createScriptProvider( aContext ), UNO_QUERY_THROW );
}
}
catch ( RuntimeException & e )