From 752cd07d085ac0aadc99bd512d49072843139032 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Tue, 19 Jan 2016 19:45:45 +0200 Subject: InterfaceContainer2 with vector instead of Sequence create an InterfaceContainer2 class to replace InterfaceContainer. It uses a std::vector instead of a Sequence for the mutable listener list, which provides far better performance. Switch all our internal use-sites to the new class. Change-Id: I6b56cfa511ded2395faa22e68fab3b2f16c3cb88 --- include/comphelper/interfacecontainer2.hxx | 304 +++++++++++++++++++++ include/comphelper/listenernotification.hxx | 8 +- include/connectivity/parameters.hxx | 4 +- include/connectivity/sdbcx/VCollection.hxx | 6 +- include/editeng/unotext.hxx | 4 +- include/linguistic/lngprophelp.hxx | 4 +- include/svx/fmgridif.hxx | 22 +- include/toolkit/awt/vclxtopwindow.hxx | 4 +- include/toolkit/awt/vclxwindow.hxx | 4 +- .../toolkit/controls/controlmodelcontainerbase.hxx | 2 +- include/toolkit/controls/unocontrol.hxx | 2 +- include/toolkit/controls/unocontrols.hxx | 2 +- include/toolkit/helper/listenermultiplexer.hxx | 4 +- include/toolkit/helper/macros.hxx | 4 +- 14 files changed, 339 insertions(+), 35 deletions(-) create mode 100644 include/comphelper/interfacecontainer2.hxx (limited to 'include') diff --git a/include/comphelper/interfacecontainer2.hxx b/include/comphelper/interfacecontainer2.hxx new file mode 100644 index 000000000000..228fc21bd529 --- /dev/null +++ b/include/comphelper/interfacecontainer2.hxx @@ -0,0 +1,304 @@ +/* -*- 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_COMPHELPER_INTERFACECONTAINER2_H +#define INCLUDED_COMPHELPER_INTERFACECONTAINER2_H + +#include + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include +#include + +/** */ //for docpp +namespace comphelper +{ + +namespace detail { + + /** + This is here to optimise space in the common case that there are zero or one + listeners. + */ + union element_alias2 + { + std::vector< css::uno::Reference< css::uno::XInterface > > *pAsVector; + css::uno::XInterface * pAsInterface; + element_alias2() : pAsInterface(NULL) {} + }; + +} + + +class OInterfaceContainerHelper2; +/** + This is the iterator of a InterfaceContainerHelper. Typically + one constructs an instance on the stack for one firing session. + It is not allowed to assign or copy an instance of this class. + + @see OInterfaceContainerHelper + */ +class CPPUHELPER_DLLPUBLIC OInterfaceIteratorHelper2 +{ +public: + /** + Create an iterator over the elements of the container. The iterator + copies the elements of the conatainer. A change to the container + during the lifetime of an iterator is allowed and does not + affect the iterator-instance. The iterator and the container take cares + themself for concurrent access, no additional guarding is necessary. + + Remark: The copy is on demand. The iterator copy the elements only if the container + change the contents. It is not allowed to destroy the container as long + as an iterator exist. + + @param rCont the container of the elements. + */ + OInterfaceIteratorHelper2( OInterfaceContainerHelper2 & rCont ); + + /** + Releases the connection to the container. + */ + ~OInterfaceIteratorHelper2(); + + /** Return true, if there are more elements in the iterator. */ + bool SAL_CALL hasMoreElements() const + { return nRemain != 0; } + /** Return the next element of the iterator. Calling this method if + hasMoreElements() has returned false, is an error. Cast the + returned pointer to the + */ + css::uno::XInterface * SAL_CALL next(); + + /** Removes the current element (the last one returned by next()) + from the underlying container. Calling this method before + next() has been called or calling it twice with no next() + inbetween is an error. + */ + void SAL_CALL remove(); + +private: + OInterfaceContainerHelper2 & rCont; + bool bIsList; + detail::element_alias2 aData; + sal_Int32 nRemain; + + OInterfaceIteratorHelper2( const OInterfaceIteratorHelper2 & ) + SAL_DELETED_FUNCTION; + OInterfaceIteratorHelper2 & operator = ( const OInterfaceIteratorHelper2 & ) + SAL_DELETED_FUNCTION; +}; + + +/** + A container of interfaces. To access the elements use an iterator. + This implementation is thread save. + + @see OInterfaceIteratorHelper + */ +class CPPUHELPER_DLLPUBLIC OInterfaceContainerHelper2 +{ +public: + // these are here to force memory de/allocation to sal lib. + inline static void * SAL_CALL operator new( size_t nSize ) + { return ::rtl_allocateMemory( nSize ); } + inline static void SAL_CALL operator delete( void * pMem ) + { ::rtl_freeMemory( pMem ); } + inline static void * SAL_CALL operator new( size_t, void * pMem ) + { return pMem; } + inline static void SAL_CALL operator delete( void *, void * ) + {} + + /** + Create an interface container. + + @param rMutex the mutex to protect multi thread access. + The lifetime must be longer than the lifetime + of this object. + */ + OInterfaceContainerHelper2( ::osl::Mutex & rMutex ); + /** + Release all interfaces. All iterators must be destroyed before + the container is destructed. + */ + ~OInterfaceContainerHelper2(); + /** + Return the number of Elements in the container. Only useful if you have acquired + the mutex. + */ + sal_Int32 SAL_CALL getLength() const; + + /** + Return all interfaces added to this container. + **/ + std::vector< css::uno::Reference< css::uno::XInterface > > SAL_CALL getElements() const; + + /** Inserts an element into the container. The position is not specified, thus it is not + specified in which order events are fired. + + @attention + If you add the same interface more than once, then it will be added to the elements list + more than once and thus if you want to remove that interface from the list, you have to call + removeInterface() the same number of times. + In the latter case, you will also get events fired more than once (if the interface is a + listener interface). + + @param rxIFace + interface to be added; it is allowed to insert null or + the same interface more than once + @return + the new count of elements in the container + */ + sal_Int32 SAL_CALL addInterface( const css::uno::Reference< css::uno::XInterface > & rxIFace ); + /** Removes an element from the container. It uses interface equality to remove the interface. + + @param rxIFace + interface to be removed + @return + the new count of elements in the container + */ + sal_Int32 SAL_CALL removeInterface( const css::uno::Reference< css::uno::XInterface > & rxIFace ); + /** + Call disposing on all object in the container that + support XEventListener. Than clear the container. + */ + void SAL_CALL disposeAndClear( const css::lang::EventObject & rEvt ); + /** + Clears the container without calling disposing(). + */ + void SAL_CALL clear(); + + /** Executes a functor for each contained listener of specified type, e.g. + forEach(.... + + If a css::lang::DisposedException occurs which relates to + the called listener, then that listener is removed from the container. + + @tparam ListenerT listener type + @tparam FuncT unary functor type, let your compiler deduce this for you + @param func unary functor object expecting an argument of type + css::uno::Reference + */ + template + inline void forEach( FuncT const& func ); + + /** Calls a UNO listener method for each contained listener. + + The listener method must take a single argument of type EventT, + and return void. + + If a css::lang::DisposedException occurs which relates to + the called listener, then that listener is removed from the container. + + @tparam ListenerT UNO event listener type, let your compiler deduce this for you + @tparam EventT event type, let your compiler deduce this for you + @param NotificationMethod + Pointer to a method of a ListenerT interface. + @param Event + Event to notify to all contained listeners + + Example: +@code + awt::PaintEvent aEvent( static_cast< cppu::OWeakObject* >( this ), ... ); + listeners.notifyEach( &XPaintListener::windowPaint, aEvent ); +@endcode + */ + template< typename ListenerT, typename EventT > + inline void notifyEach( void ( SAL_CALL ListenerT::*NotificationMethod )( const EventT& ), const EventT& Event ); + +private: +friend class OInterfaceIteratorHelper2; + /** + bIsList == TRUE -> aData.pAsVector of type vector< XInterfaceSequence >, + otherwise aData.pAsInterface == of type (XEventListener *) + */ + detail::element_alias2 aData; + ::osl::Mutex & rMutex; + /** TRUE -> used by an iterator. */ + bool bInUse; + /** TRUE -> aData.pAsVector is of type Sequence< XInterfaceSequence >. */ + bool bIsList; + + OInterfaceContainerHelper2( const OInterfaceContainerHelper2 & ) + SAL_DELETED_FUNCTION; + OInterfaceContainerHelper2 & operator = ( const OInterfaceContainerHelper2 & ) + SAL_DELETED_FUNCTION; + + /* + Duplicate content of the conaitner and release the old one without destroying. + The mutex must be locked and the memberbInUse must be true. + */ + void copyAndResetInUse(); + +private: + template< typename ListenerT, typename EventT > + class NotifySingleListener + { + private: + typedef void ( SAL_CALL ListenerT::*NotificationMethod )( const EventT& ); + NotificationMethod m_pMethod; + const EventT& m_rEvent; + public: + NotifySingleListener( NotificationMethod method, const EventT& event ) : m_pMethod( method ), m_rEvent( event ) { } + + void operator()( const css::uno::Reference& listener ) const + { + (listener.get()->*m_pMethod)( m_rEvent ); + } + }; +}; + +template +inline void OInterfaceContainerHelper2::forEach( FuncT const& func ) +{ + OInterfaceIteratorHelper2 iter( *this ); + while (iter.hasMoreElements()) { + css::uno::Reference const xListener( iter.next(), css::uno::UNO_QUERY ); + if (xListener.is()) { + try { + func( xListener ); + } + catch (css::lang::DisposedException const& exc) { + if (exc.Context == xListener) + iter.remove(); + } + } + } +} + +template< typename ListenerT, typename EventT > +inline void OInterfaceContainerHelper2::notifyEach( void ( SAL_CALL ListenerT::*NotificationMethod )( const EventT& ), const EventT& Event ) +{ + forEach< ListenerT, NotifySingleListener< ListenerT, EventT > >( NotifySingleListener< ListenerT, EventT >( NotificationMethod, Event ) ); +} + +} +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/comphelper/listenernotification.hxx b/include/comphelper/listenernotification.hxx index fd11ce6574a4..95164393ddce 100644 --- a/include/comphelper/listenernotification.hxx +++ b/include/comphelper/listenernotification.hxx @@ -20,7 +20,7 @@ #ifndef INCLUDED_COMPHELPER_LISTENERNOTIFICATION_HXX #define INCLUDED_COMPHELPER_LISTENERNOTIFICATION_HXX -#include +#include #include #include @@ -57,7 +57,7 @@ namespace comphelper class COMPHELPER_DLLPUBLIC OListenerContainer { private: - ::cppu::OInterfaceContainerHelper m_aListeners; + ::comphelper::OInterfaceContainerHelper2 m_aListeners; public: /** sends a XEventObject::disposing notification to all listeners, and clears the @@ -79,9 +79,9 @@ namespace comphelper /** creates an iterator for looping through all registered listeners */ - ::std::unique_ptr< ::cppu::OInterfaceIteratorHelper > createIterator() + ::std::unique_ptr< ::comphelper::OInterfaceIteratorHelper2 > createIterator() { - ::std::unique_ptr< ::cppu::OInterfaceIteratorHelper > pIterator( new ::cppu::OInterfaceIteratorHelper( m_aListeners ) ); + ::std::unique_ptr< ::comphelper::OInterfaceIteratorHelper2 > pIterator( new ::comphelper::OInterfaceIteratorHelper2( m_aListeners ) ); return pIterator; } diff --git a/include/connectivity/parameters.hxx b/include/connectivity/parameters.hxx index b2a19b4925fc..e060604cc7b0 100644 --- a/include/connectivity/parameters.hxx +++ b/include/connectivity/parameters.hxx @@ -35,7 +35,7 @@ #include #include #include -#include +#include namespace dbtools @@ -98,7 +98,7 @@ namespace dbtools private: ::osl::Mutex& m_rMutex; - ::cppu::OInterfaceContainerHelper m_aParameterListeners; + ::comphelper::OInterfaceContainerHelper2 m_aParameterListeners; css::uno::Reference< css::uno::XComponentContext > m_xContext; diff --git a/include/connectivity/sdbcx/VCollection.hxx b/include/connectivity/sdbcx/VCollection.hxx index 3250a81bc20d..998cf7805bf6 100644 --- a/include/connectivity/sdbcx/VCollection.hxx +++ b/include/connectivity/sdbcx/VCollection.hxx @@ -32,7 +32,7 @@ #include #include #include -#include +#include #include #include #include @@ -92,8 +92,8 @@ namespace connectivity protected: ::std::unique_ptr m_pElements; - ::cppu::OInterfaceContainerHelper m_aContainerListeners; - ::cppu::OInterfaceContainerHelper m_aRefreshListeners; + ::comphelper::OInterfaceContainerHelper2 m_aContainerListeners; + ::comphelper::OInterfaceContainerHelper2 m_aRefreshListeners; protected: ::cppu::OWeakObject& m_rParent; // parent of the collection diff --git a/include/editeng/unotext.hxx b/include/editeng/unotext.hxx index ff68e5584c52..cbe5b8be6057 100644 --- a/include/editeng/unotext.hxx +++ b/include/editeng/unotext.hxx @@ -43,7 +43,7 @@ #include #include #include -#include +#include #include #include #include @@ -518,7 +518,7 @@ private: // for xComponent ::osl::Mutex maDisposeContainerMutex; - ::cppu::OInterfaceContainerHelper maDisposeListeners; + ::comphelper::OInterfaceContainerHelper2 maDisposeListeners; bool mbDisposing; protected: diff --git a/include/linguistic/lngprophelp.hxx b/include/linguistic/lngprophelp.hxx index 6039555734cb..c432b7bbe519 100644 --- a/include/linguistic/lngprophelp.hxx +++ b/include/linguistic/lngprophelp.hxx @@ -21,7 +21,7 @@ #define INCLUDED_LINGUISTIC_LNGPROPHELP_HXX #include -#include +#include #include #include #include @@ -60,7 +60,7 @@ class PropertyChgHelper : { css::uno::Sequence< OUString > aPropNames; css::uno::Reference< css::uno::XInterface > xMyEvtObj; - ::cppu::OInterfaceContainerHelper aLngSvcEvtListeners; + ::comphelper::OInterfaceContainerHelper2 aLngSvcEvtListeners; css::uno::Reference< css::beans::XPropertySet > xPropSet; int nEvtFlags; // flags for event types allowed to be launched diff --git a/include/svx/fmgridif.hxx b/include/svx/fmgridif.hxx index 25370fafe376..9fe961b3452a 100644 --- a/include/svx/fmgridif.hxx +++ b/include/svx/fmgridif.hxx @@ -67,7 +67,7 @@ public: // FmXModifyMultiplexer class SAL_WARN_UNUSED FmXModifyMultiplexer :public OWeakSubObject - ,public ::cppu::OInterfaceContainerHelper + ,public ::comphelper::OInterfaceContainerHelper2 ,public css::util::XModifyListener { public: @@ -81,7 +81,7 @@ public: // css::util::XModifyListener virtual void SAL_CALL modified(const css::lang::EventObject& Source) throw(css::uno::RuntimeException, std::exception) override; -// resolve ambiguity : both OWeakObject and OInterfaceContainerHelper have these memory operators +// resolve ambiguity : both OWeakObject and OInterfaceContainerHelper2 have these memory operators void * SAL_CALL operator new( size_t size ) throw() { return OWeakSubObject::operator new(size); } void SAL_CALL operator delete( void * p ) throw() { OWeakSubObject::operator delete(p); } }; @@ -90,7 +90,7 @@ public: // FmXUpdateMultiplexer class SAL_WARN_UNUSED FmXUpdateMultiplexer : public OWeakSubObject, - public ::cppu::OInterfaceContainerHelper, + public ::comphelper::OInterfaceContainerHelper2, public css::form::XUpdateListener { public: @@ -106,7 +106,7 @@ public: virtual sal_Bool SAL_CALL approveUpdate(const css::lang::EventObject &) throw(css::uno::RuntimeException, std::exception) override; virtual void SAL_CALL updated(const css::lang::EventObject &) throw(css::uno::RuntimeException, std::exception) override; -// resolve ambiguity : both OWeakObject and OInterfaceContainerHelper have these memory operators +// resolve ambiguity : both OWeakObject and OInterfaceContainerHelper2 have these memory operators void * SAL_CALL operator new( size_t size ) throw() { return OWeakSubObject::operator new(size); } void SAL_CALL operator delete( void * p ) throw() { OWeakSubObject::operator delete(p); } }; @@ -115,7 +115,7 @@ public: // FmXSelectionMultiplexer class SAL_WARN_UNUSED FmXSelectionMultiplexer :public OWeakSubObject - ,public ::cppu::OInterfaceContainerHelper + ,public ::comphelper::OInterfaceContainerHelper2 ,public css::view::XSelectionChangeListener { public: @@ -130,7 +130,7 @@ public: // css::view::XSelectionChangeListener virtual void SAL_CALL selectionChanged( const css::lang::EventObject& aEvent ) throw (css::uno::RuntimeException, std::exception) override; -// resolve ambiguity : both OWeakObject and OInterfaceContainerHelper have these memory operators +// resolve ambiguity : both OWeakObject and OInterfaceContainerHelper2 have these memory operators void * SAL_CALL operator new( size_t size ) throw() { return OWeakSubObject::operator new(size); } void SAL_CALL operator delete( void * p ) throw() { OWeakSubObject::operator delete(p); } }; @@ -139,7 +139,7 @@ public: // FmXGridControlMultiplexer class SAL_WARN_UNUSED FmXGridControlMultiplexer :public OWeakSubObject - ,public ::cppu::OInterfaceContainerHelper + ,public ::comphelper::OInterfaceContainerHelper2 ,public css::form::XGridControlListener { public: @@ -154,7 +154,7 @@ public: // css::view::XSelectionChangeListener virtual void SAL_CALL columnChanged( const css::lang::EventObject& _event ) throw (css::uno::RuntimeException, std::exception) override; -// resolve ambiguity : both OWeakObject and OInterfaceContainerHelper have these memory operators +// resolve ambiguity : both OWeakObject and OInterfaceContainerHelper2 have these memory operators void * SAL_CALL operator new( size_t size ) throw() { return OWeakSubObject::operator new(size); } void SAL_CALL operator delete( void * p ) throw() { OWeakSubObject::operator delete(p); } }; @@ -163,7 +163,7 @@ public: // FmXContainerMultiplexer class SAL_WARN_UNUSED FmXContainerMultiplexer : public OWeakSubObject, - public ::cppu::OInterfaceContainerHelper, + public ::comphelper::OInterfaceContainerHelper2, public css::container::XContainerListener { public: @@ -179,7 +179,7 @@ public: virtual void SAL_CALL elementRemoved(const css::container::ContainerEvent& Event) throw(css::uno::RuntimeException, std::exception) override; virtual void SAL_CALL elementReplaced(const css::container::ContainerEvent& Event) throw(css::uno::RuntimeException, std::exception) override; -// resolve ambiguity : both OWeakObject and OInterfaceContainerHelper have these memory operators +// resolve ambiguity : both OWeakObject and OInterfaceContainerHelper2 have these memory operators void * SAL_CALL operator new( size_t size ) throw() { return OWeakSubObject::operator new(size); } void SAL_CALL operator delete( void * p ) throw() { OWeakSubObject::operator delete(p); } }; @@ -336,7 +336,7 @@ class SAL_WARN_UNUSED SVX_DLLPUBLIC FmXGridPeer: { css::uno::Reference< css::container::XIndexContainer > m_xColumns; css::uno::Reference< css::sdbc::XRowSet > m_xCursor; - ::cppu::OInterfaceContainerHelper m_aModifyListeners, + ::comphelper::OInterfaceContainerHelper2 m_aModifyListeners, m_aUpdateListeners, m_aContainerListeners, m_aSelectionListeners, diff --git a/include/toolkit/awt/vclxtopwindow.hxx b/include/toolkit/awt/vclxtopwindow.hxx index 5335e700f3e0..1c0b6af7fb9b 100644 --- a/include/toolkit/awt/vclxtopwindow.hxx +++ b/include/toolkit/awt/vclxtopwindow.hxx @@ -46,7 +46,7 @@ protected: virtual vcl::Window* GetWindowImpl() = 0; - virtual ::cppu::OInterfaceContainerHelper& GetTopWindowListenersImpl() = 0; + virtual ::comphelper::OInterfaceContainerHelper2& GetTopWindowListenersImpl() = 0; VCLXTopWindow_Base( const bool _bSupportSystemWindowPeer ); @@ -86,7 +86,7 @@ class TOOLKIT_DLLPUBLIC VCLXTopWindow: public VCLXTopWindow_Base, { protected: virtual vcl::Window* GetWindowImpl() override; - virtual ::cppu::OInterfaceContainerHelper& GetTopWindowListenersImpl() override; + virtual ::comphelper::OInterfaceContainerHelper2& GetTopWindowListenersImpl() override; public: VCLXTopWindow(bool bWHWND = false); diff --git a/include/toolkit/awt/vclxwindow.hxx b/include/toolkit/awt/vclxwindow.hxx index a353c4a44b43..67d6f7ed39a9 100644 --- a/include/toolkit/awt/vclxwindow.hxx +++ b/include/toolkit/awt/vclxwindow.hxx @@ -102,8 +102,8 @@ protected: bool bWithDefaults = false ); virtual void GetPropertyIds( std::list< sal_uInt16 > &aIds ); - ::cppu::OInterfaceContainerHelper& GetContainerListeners(); - ::cppu::OInterfaceContainerHelper& GetTopWindowListeners(); + ::comphelper::OInterfaceContainerHelper2& GetContainerListeners(); + ::comphelper::OInterfaceContainerHelper2& GetTopWindowListeners(); public: typedef ::std::function Callback; diff --git a/include/toolkit/controls/controlmodelcontainerbase.hxx b/include/toolkit/controls/controlmodelcontainerbase.hxx index 87918266d03f..cf2e214721e0 100644 --- a/include/toolkit/controls/controlmodelcontainerbase.hxx +++ b/include/toolkit/controls/controlmodelcontainerbase.hxx @@ -79,7 +79,7 @@ public: protected: ContainerListenerMultiplexer maContainerListeners; - ::cppu::OInterfaceContainerHelper maChangeListeners; + ::comphelper::OInterfaceContainerHelper2 maChangeListeners; UnoControlModelHolderList maModels; AllGroups maGroups; diff --git a/include/toolkit/controls/unocontrol.hxx b/include/toolkit/controls/unocontrol.hxx index d31f49bcddce..a410c722add8 100644 --- a/include/toolkit/controls/unocontrol.hxx +++ b/include/toolkit/controls/unocontrol.hxx @@ -92,7 +92,7 @@ protected: MouseListenerMultiplexer maMouseListeners; MouseMotionListenerMultiplexer maMouseMotionListeners; PaintListenerMultiplexer maPaintListeners; - ::cppu::OInterfaceContainerHelper maModeChangeListeners; + ::comphelper::OInterfaceContainerHelper2 maModeChangeListeners; css::uno::Reference< css::uno::XInterface > mxContext; css::uno::Reference< css::awt::XControlModel > mxModel; diff --git a/include/toolkit/controls/unocontrols.hxx b/include/toolkit/controls/unocontrols.hxx index 31b92959b7c5..220c32aa933d 100644 --- a/include/toolkit/controls/unocontrols.hxx +++ b/include/toolkit/controls/unocontrols.hxx @@ -877,7 +877,7 @@ private: protected: std::unique_ptr m_xData; - ::cppu::OInterfaceContainerHelper m_aItemListListeners; + ::comphelper::OInterfaceContainerHelper2 m_aItemListListeners; }; diff --git a/include/toolkit/helper/listenermultiplexer.hxx b/include/toolkit/helper/listenermultiplexer.hxx index 49dab94db067..d1a1e6a11e07 100644 --- a/include/toolkit/helper/listenermultiplexer.hxx +++ b/include/toolkit/helper/listenermultiplexer.hxx @@ -43,7 +43,7 @@ #include #include #include -#include +#include #include #include #include @@ -54,7 +54,7 @@ class TOOLKIT_DLLPUBLIC ListenerMultiplexerBase : public MutexHelper, - public ::cppu::OInterfaceContainerHelper, + public ::comphelper::OInterfaceContainerHelper2, public css::uno::XInterface { private: diff --git a/include/toolkit/helper/macros.hxx b/include/toolkit/helper/macros.hxx index e844bd350677..20e7c7cbf30a 100644 --- a/include/toolkit/helper/macros.hxx +++ b/include/toolkit/helper/macros.hxx @@ -142,7 +142,7 @@ void ClassName::disposing( const css::lang::EventObject& ) throw(css::uno::Runti #define IMPL_TABLISTENERMULTIPLEXER_LISTENERMETHOD_BODY_1PARAM( ClassName, InterfaceName, MethodName, ParamType1 ) \ { \ ParamType1 aMulti( evt ); \ - ::cppu::OInterfaceIteratorHelper aIt( *this ); \ + ::comphelper::OInterfaceIteratorHelper2 aIt( *this ); \ while( aIt.hasMoreElements() ) \ { \ css::uno::Reference< InterfaceName > xListener( \ @@ -168,7 +168,7 @@ void ClassName::disposing( const css::lang::EventObject& ) throw(css::uno::Runti { \ EventType aMulti( evt ); \ aMulti.Source = &GetContext(); \ - ::cppu::OInterfaceIteratorHelper aIt( *this ); \ + ::comphelper::OInterfaceIteratorHelper2 aIt( *this ); \ while( aIt.hasMoreElements() ) \ { \ css::uno::Reference< InterfaceName > xListener( \ -- cgit