summaryrefslogtreecommitdiff
path: root/scripting
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2012-09-29 17:20:22 +0200
committerStephan Bergmann <sbergman@redhat.com>2012-09-29 18:18:28 +0200
commitc2ca6fabd1afc3fc07001721c2069d3c8db7000a (patch)
tree350741d6d19564bcaf00506bd7d22b4c644e0fdc /scripting
parentf05d7abf93bbcf443cb0b5759ca19992e2fa85a3 (diff)
Use comphelper::getComponentContext
...and some further clean up. Change-Id: Id294c0f38fe0041646fc86cacbd2e19734c746a9
Diffstat (limited to 'scripting')
-rw-r--r--scripting/Library_protocolhandler.mk1
-rw-r--r--scripting/source/protocolhandler/scripthandler.cxx9
-rw-r--r--scripting/source/vbaevents/eventhelper.cxx12
3 files changed, 7 insertions, 15 deletions
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 <vcl/abstdlg.hxx>
#include <tools/diagnose_ex.h>
+#include <comphelper/processfactory.hxx>
#include <cppuhelper/factory.hxx>
#include <cppuhelper/exc_hlp.hxx>
#include <util/util.hxx>
@@ -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()