Kaydet (Commit) 2358dfc6 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Clean up previous commit

...and add missing XServiceInfo implementations

Change-Id: I719cd10b6202d94e751805e1b838eb3f193e24d1
üst 6f7b0a1f
...@@ -70,16 +70,12 @@ ...@@ -70,16 +70,12 @@
#include <comphelper/anytostring.hxx> #include <comphelper/anytostring.hxx>
#include <com/sun/star/script/XScriptListener.hpp> #include <com/sun/star/script/XScriptListener.hpp>
#include <cppuhelper/implbase1.hxx> #include <cppuhelper/implbase.hxx>
#include <cppuhelper/implbase3.hxx>
#include <cppuhelper/implbase2.hxx>
#include <comphelper/evtmethodhelper.hxx> #include <comphelper/evtmethodhelper.hxx>
#include <list> #include <list>
#include <unordered_map> #include <unordered_map>
#include <service.hxx>
#define ASYNC 0 #define ASYNC 0
// primitive support for asynchronous handling of // primitive support for asynchronous handling of
...@@ -461,7 +457,7 @@ ScriptEventHelper::createEvents( const OUString& sCodeName ) ...@@ -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 class ReadOnlyEventsNameContainer : public NameContainer_BASE
{ {
...@@ -549,7 +545,7 @@ ReadOnlyEventsNameContainer::hasByName( const OUString& aName ) throw (RuntimeEx ...@@ -549,7 +545,7 @@ ReadOnlyEventsNameContainer::hasByName( const OUString& aName ) throw (RuntimeEx
return sal_True; return sal_True;
} }
typedef ::cppu::WeakImplHelper1< XScriptEventsSupplier > EventsSupplier_BASE; typedef ::cppu::WeakImplHelper< XScriptEventsSupplier > EventsSupplier_BASE;
class ReadOnlyEventsSupplier : public EventsSupplier_BASE class ReadOnlyEventsSupplier : public EventsSupplier_BASE
{ {
...@@ -563,7 +559,7 @@ private: ...@@ -563,7 +559,7 @@ private:
Reference< container::XNameContainer > m_xNameContainer; 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_ID_MODEL 1
#define EVENTLSTNR_PROPERTY_MODEL OUString( "Model" ) #define EVENTLSTNR_PROPERTY_MODEL OUString( "Model" )
...@@ -622,6 +618,25 @@ public: ...@@ -622,6 +618,25 @@ public:
setShellFromModel(); 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: protected:
// OPropertySetHelper // OPropertySetHelper
virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper( ) SAL_OVERRIDE; virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper( ) SAL_OVERRIDE;
...@@ -1017,7 +1032,7 @@ EventListener::firing_Impl(const ScriptEvent& evt, Any* pRet ) throw(RuntimeExce ...@@ -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 class VBAToOOEventDescGen : public VBAToOOEventDescGen_BASE
...@@ -1028,6 +1043,26 @@ public: ...@@ -1028,6 +1043,26 @@ public:
// XVBAToOOEventDescGen // XVBAToOOEventDescGen
virtual Sequence< ScriptEventDescriptor > SAL_CALL getEventDescriptions( const OUString& sCtrlServiceName, const OUString& sCodeName ) throw (RuntimeException, std::exception) SAL_OVERRIDE; 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; 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: private:
Reference< XComponentContext > m_xContext; Reference< XComponentContext > m_xContext;
...@@ -1052,42 +1087,6 @@ VBAToOOEventDescGen::getEventSupplier( const Reference< XInterface >& xControl, ...@@ -1052,42 +1087,6 @@ VBAToOOEventDescGen::getEventSupplier( const Reference< XInterface >& xControl,
return xSupplier; 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 extern "C" SAL_DLLPUBLIC_EXPORT ::com::sun::star::uno::XInterface* SAL_CALL
ooo_vba_EventListener_get_implementation(::com::sun::star::uno::XComponentContext* context, ooo_vba_EventListener_get_implementation(::com::sun::star::uno::XComponentContext* context,
::com::sun::star::uno::Sequence<css::uno::Any> const &) ::com::sun::star::uno::Sequence<css::uno::Any> const &)
......
/* -*- 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: */
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
--> -->
<component loader="com.sun.star.loader.SharedLibrary" environment="@CPPU_ENV@" <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" <implementation name="ooo.vba.EventListener"
constructor="ooo_vba_EventListener_get_implementation"> constructor="ooo_vba_EventListener_get_implementation">
<service name="ooo.vba.EventListener"/> <service name="ooo.vba.EventListener"/>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment