summaryrefslogtreecommitdiff
path: root/scripting/source/vbaevents
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2015-03-12 10:47:43 +0100
committerStephan Bergmann <sbergman@redhat.com>2015-03-12 10:48:03 +0100
commit2358dfc60274fdc928ec614a893344608b8f3c52 (patch)
tree09ac8cbbf4a83cefbeee0fe4b36f5483b6be73ec /scripting/source/vbaevents
parent6f7b0a1fad61e14ac82d14fad2280344169c51ad (diff)
Clean up previous commit
...and add missing XServiceInfo implementations Change-Id: I719cd10b6202d94e751805e1b838eb3f193e24d1
Diffstat (limited to 'scripting/source/vbaevents')
-rw-r--r--scripting/source/vbaevents/eventhelper.cxx89
-rw-r--r--scripting/source/vbaevents/service.hxx49
-rw-r--r--scripting/source/vbaevents/vbaevents.component2
3 files changed, 45 insertions, 95 deletions
diff --git a/scripting/source/vbaevents/eventhelper.cxx b/scripting/source/vbaevents/eventhelper.cxx
index babe1cb35cb4..fe942f4f909e 100644
--- a/scripting/source/vbaevents/eventhelper.cxx
+++ b/scripting/source/vbaevents/eventhelper.cxx
@@ -70,16 +70,12 @@
#include <comphelper/anytostring.hxx>
#include <com/sun/star/script/XScriptListener.hpp>
-#include <cppuhelper/implbase1.hxx>
-#include <cppuhelper/implbase3.hxx>
-#include <cppuhelper/implbase2.hxx>
+#include <cppuhelper/implbase.hxx>
#include <comphelper/evtmethodhelper.hxx>
#include <list>
#include <unordered_map>
-#include <service.hxx>
-
#define ASYNC 0
// primitive support for asynchronous handling of
@@ -461,7 +457,7 @@ ScriptEventHelper::createEvents( const OUString& sCodeName )
}
-typedef ::cppu::WeakImplHelper1< container::XNameContainer > NameContainer_BASE;
+typedef ::cppu::WeakImplHelper< container::XNameContainer > NameContainer_BASE;
class ReadOnlyEventsNameContainer : public NameContainer_BASE
{
@@ -549,7 +545,7 @@ ReadOnlyEventsNameContainer::hasByName( const OUString& aName ) throw (RuntimeEx
return sal_True;
}
-typedef ::cppu::WeakImplHelper1< XScriptEventsSupplier > EventsSupplier_BASE;
+typedef ::cppu::WeakImplHelper< XScriptEventsSupplier > EventsSupplier_BASE;
class ReadOnlyEventsSupplier : public EventsSupplier_BASE
{
@@ -563,7 +559,7 @@ private:
Reference< container::XNameContainer > m_xNameContainer;
};
-typedef ::cppu::WeakImplHelper3< XScriptListener, util::XCloseListener, lang::XInitialization > EventListener_BASE;
+typedef ::cppu::WeakImplHelper< XScriptListener, util::XCloseListener, lang::XInitialization, css::lang::XServiceInfo > EventListener_BASE;
#define EVENTLSTNR_PROPERTY_ID_MODEL 1
#define EVENTLSTNR_PROPERTY_MODEL OUString( "Model" )
@@ -622,6 +618,25 @@ public:
setShellFromModel();
}
+ OUString SAL_CALL getImplementationName()
+ throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
+ {
+ return OUString( "ooo.vba.EventListener" );
+ }
+
+ sal_Bool SAL_CALL supportsService(OUString const & ServiceName)
+ throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
+ {
+ return cppu::supportsService(this, ServiceName);
+ }
+
+ css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames()
+ throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
+ {
+ const OUString strName( getImplementationName() );
+ return Sequence< OUString >( &strName, 1 );
+ }
+
protected:
// OPropertySetHelper
virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper( ) SAL_OVERRIDE;
@@ -1017,7 +1032,7 @@ EventListener::firing_Impl(const ScriptEvent& evt, Any* pRet ) throw(RuntimeExce
}
}
-typedef ::cppu::WeakImplHelper1< XVBAToOOEventDescGen > VBAToOOEventDescGen_BASE;
+typedef ::cppu::WeakImplHelper< XVBAToOOEventDescGen, css::lang::XServiceInfo > VBAToOOEventDescGen_BASE;
class VBAToOOEventDescGen : public VBAToOOEventDescGen_BASE
@@ -1028,6 +1043,26 @@ public:
// XVBAToOOEventDescGen
virtual Sequence< ScriptEventDescriptor > SAL_CALL getEventDescriptions( const OUString& sCtrlServiceName, const OUString& sCodeName ) throw (RuntimeException, std::exception) SAL_OVERRIDE;
virtual Reference< XScriptEventsSupplier > SAL_CALL getEventSupplier( const Reference< XInterface >& xControl, const OUString& sCodeName ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
+
+ OUString SAL_CALL getImplementationName()
+ throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
+ {
+ return OUString( "ooo.vba.VBAToOOEventDesc" );
+ }
+
+ sal_Bool SAL_CALL supportsService(OUString const & ServiceName)
+ throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
+ {
+ return cppu::supportsService(this, ServiceName);
+ }
+
+ css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames()
+ throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
+ {
+ const OUString strName( getImplementationName() );
+ return Sequence< OUString >( &strName, 1 );
+ }
+
private:
Reference< XComponentContext > m_xContext;
@@ -1052,42 +1087,6 @@ VBAToOOEventDescGen::getEventSupplier( const Reference< XInterface >& xControl,
return xSupplier;
}
-// Component related
-
-namespace evtlstner
-{
- OUString SAL_CALL getImplementationName()
- {
- return OUString( "ooo.vba.EventListener" );
- }
-
- uno::Reference< XInterface > SAL_CALL create(
- Reference< XComponentContext > const & xContext )
- {
- return static_cast< lang::XTypeProvider * >( new EventListener( xContext ) );
- }
-
- Sequence< OUString > SAL_CALL getSupportedServiceNames()
- {
- const OUString strName( ::evtlstner::getImplementationName() );
- return Sequence< OUString >( &strName, 1 );
- }
-}
-namespace ooevtdescgen
-{
- OUString SAL_CALL getImplementationName()
- {
- return OUString( "ooo.vba.VBAToOOEventDesc" );
- }
-
- Sequence< OUString > SAL_CALL getSupportedServiceNames()
- {
- const OUString strName( ::ooevtdescgen::getImplementationName() );
- return Sequence< OUString >( &strName, 1 );
- }
-}
-
-
extern "C" SAL_DLLPUBLIC_EXPORT ::com::sun::star::uno::XInterface* SAL_CALL
ooo_vba_EventListener_get_implementation(::com::sun::star::uno::XComponentContext* context,
::com::sun::star::uno::Sequence<css::uno::Any> const &)
diff --git a/scripting/source/vbaevents/service.hxx b/scripting/source/vbaevents/service.hxx
deleted file mode 100644
index cff03cb6d1e5..000000000000
--- a/scripting/source/vbaevents/service.hxx
+++ /dev/null
@@ -1,49 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#ifndef INCLUDED_SCRIPTING_SOURCE_VBAEVENTS_SERVICE_HXX
-#define INCLUDED_SCRIPTING_SOURCE_VBAEVENTS_SERVICE_HXX
-
-#include <sal/config.h>
-
-namespace evtlstner
-{
-
- // component operations
-
- OUString SAL_CALL getImplementationName();
-
- css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames();
-
-} // end evtlstner
-
-namespace ooevtdescgen
-{
-
- // component operations
-
- OUString SAL_CALL getImplementationName();
-
- css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames();
-
-} // end ooevtdescgen
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/scripting/source/vbaevents/vbaevents.component b/scripting/source/vbaevents/vbaevents.component
index cf39be08c8af..75fcf0230937 100644
--- a/scripting/source/vbaevents/vbaevents.component
+++ b/scripting/source/vbaevents/vbaevents.component
@@ -18,7 +18,7 @@
-->
<component loader="com.sun.star.loader.SharedLibrary" environment="@CPPU_ENV@"
- prefix="vbaevents" xmlns="http://openoffice.org/2010/uno-components">
+ xmlns="http://openoffice.org/2010/uno-components">
<implementation name="ooo.vba.EventListener"
constructor="ooo_vba_EventListener_get_implementation">
<service name="ooo.vba.EventListener"/>