From 2358dfc60274fdc928ec614a893344608b8f3c52 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Thu, 12 Mar 2015 10:47:43 +0100 Subject: Clean up previous commit ...and add missing XServiceInfo implementations Change-Id: I719cd10b6202d94e751805e1b838eb3f193e24d1 --- scripting/source/vbaevents/eventhelper.cxx | 89 +++++++++++++------------- scripting/source/vbaevents/service.hxx | 49 -------------- scripting/source/vbaevents/vbaevents.component | 2 +- 3 files changed, 45 insertions(+), 95 deletions(-) delete mode 100644 scripting/source/vbaevents/service.hxx (limited to 'scripting') 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 #include -#include -#include -#include +#include #include #include #include -#include - #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 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 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 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 - -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 @@ --> + xmlns="http://openoffice.org/2010/uno-components"> -- cgit