From c2ca6fabd1afc3fc07001721c2069d3c8db7000a Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Sat, 29 Sep 2012 17:20:22 +0200 Subject: Use comphelper::getComponentContext ...and some further clean up. Change-Id: Id294c0f38fe0041646fc86cacbd2e19734c746a9 --- scripting/Library_protocolhandler.mk | 1 + scripting/source/protocolhandler/scripthandler.cxx | 9 ++------- scripting/source/vbaevents/eventhelper.cxx | 12 ++++-------- 3 files changed, 7 insertions(+), 15 deletions(-) (limited to 'scripting') diff --git a/scripting/Library_protocolhandler.mk b/scripting/Library_protocolhandler.mk index 291b1ecb03c1..d2a684ab852f 100644 --- a/scripting/Library_protocolhandler.mk +++ b/scripting/Library_protocolhandler.mk @@ -38,6 +38,7 @@ $(eval $(call gb_Library_set_include,protocolhandler,\ $(eval $(call gb_Library_use_sdk_api,protocolhandler)) $(eval $(call gb_Library_use_libraries,protocolhandler,\ + comphelper \ cppu \ cppuhelper \ fwe \ diff --git a/scripting/source/protocolhandler/scripthandler.cxx b/scripting/source/protocolhandler/scripthandler.cxx index ed41ebcfadc2..1881c917c4ae 100644 --- a/scripting/source/protocolhandler/scripthandler.cxx +++ b/scripting/source/protocolhandler/scripthandler.cxx @@ -41,6 +41,7 @@ #include #include +#include #include #include #include @@ -50,7 +51,6 @@ #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; @@ -383,13 +383,8 @@ void ScriptProtocolHandler::createScriptProvider() // if nothing of this is successful, use the master script provider if ( !m_xScriptProvider.is() ) { - Reference< XPropertySet > xProps( m_xFactory, UNO_QUERY_THROW ); - - ::rtl::OUString dc( - "DefaultContext" ); - Reference< XComponentContext > xCtx( - xProps->getPropertyValue( dc ), UNO_QUERY_THROW ); + comphelper::getComponentContext( m_xFactory ) ); ::rtl::OUString tmspf( "/singletons/com.sun.star.script.provider.theMasterScriptProviderFactory"); diff --git a/scripting/source/vbaevents/eventhelper.cxx b/scripting/source/vbaevents/eventhelper.cxx index 00981f075898..7249d143a8d0 100644 --- a/scripting/source/vbaevents/eventhelper.cxx +++ b/scripting/source/vbaevents/eventhelper.cxx @@ -368,14 +368,10 @@ eventMethodToDescriptor( const ::rtl::OUString& rEventMethod, ScriptEventDescrip } -ScriptEventHelper::ScriptEventHelper( const Reference< XInterface >& xControl ) : m_xControl( xControl ) -{ - Reference < beans::XPropertySet > xProps( - ::comphelper::getProcessServiceFactory(), UNO_QUERY_THROW ); - m_xCtx.set( xProps->getPropertyValue( rtl::OUString( - "DefaultContext" )), - uno::UNO_QUERY_THROW ); -} +ScriptEventHelper::ScriptEventHelper( const Reference< XInterface >& xControl ): + m_xCtx( comphelper::getProcessComponentContext() ), + m_xControl( xControl ) +{} Sequence< rtl::OUString > ScriptEventHelper::getEventListeners() -- cgit