diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2016-01-19 19:45:45 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2016-01-25 08:52:03 +0200 |
commit | 752cd07d085ac0aadc99bd512d49072843139032 (patch) | |
tree | 21ff2f55761b34bfdd721b5e1ed43333e8874e46 /dbaccess | |
parent | 0e7cd653ea90da388820220bf6a3eb140b57bbd6 (diff) |
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
Diffstat (limited to 'dbaccess')
28 files changed, 73 insertions, 68 deletions
diff --git a/dbaccess/source/core/api/RowSet.cxx b/dbaccess/source/core/api/RowSet.cxx index 58e450859e7b..ae66546c4521 100644 --- a/dbaccess/source/core/api/RowSet.cxx +++ b/dbaccess/source/core/api/RowSet.cxx @@ -103,26 +103,25 @@ com_sun_star_comp_dba_ORowSet_get_implementation(css::uno::XComponentContext* co } #define NOTIFY_LISTENERS_CHECK(_rListeners,T,method) \ - Sequence< Reference< XInterface > > aListenerSeq = _rListeners.getElements(); \ + std::vector< Reference< XInterface > > aListenerSeq = _rListeners.getElements(); \ \ - const Reference< XInterface >* pxIntBegin = aListenerSeq.getConstArray(); \ - const Reference< XInterface >* pxInt = pxIntBegin + aListenerSeq.getLength(); \ + auto it = aListenerSeq.rbegin(); \ + const auto itEnd = aListenerSeq.rend(); \ \ _rGuard.clear(); \ bool bCheck = true; \ - while( pxInt > pxIntBegin && bCheck ) \ + for ( ; it != itEnd; ) \ { \ try \ { \ - while( pxInt > pxIntBegin && bCheck ) \ - { \ - --pxInt; \ - bCheck = static_cast< T* >( pxInt->get() )->method(aEvt); \ - } \ + bCheck = static_cast< T* >( it->get() )->method(aEvt); \ + if (!bCheck) \ + break; \ } \ catch( RuntimeException& ) \ { \ } \ + ++it; \ } \ _rGuard.reset(); @@ -1514,7 +1513,7 @@ void ORowSet::approveExecution() throw (RowSetVetoException, RuntimeException) ::osl::MutexGuard aGuard( m_aColumnsMutex ); EventObject aEvt(*this); - OInterfaceIteratorHelper aApproveIter( m_aApproveListeners ); + OInterfaceIteratorHelper2 aApproveIter( m_aApproveListeners ); while ( aApproveIter.hasMoreElements() ) { Reference< XRowSetApproveListener > xListener( static_cast< XRowSetApproveListener* >( aApproveIter.next() ) ); diff --git a/dbaccess/source/core/api/RowSet.hxx b/dbaccess/source/core/api/RowSet.hxx index 75822a4b0732..4bc14a83e252 100644 --- a/dbaccess/source/core/api/RowSet.hxx +++ b/dbaccess/source/core/api/RowSet.hxx @@ -42,6 +42,7 @@ #include <com/sun/star/sdb/XRowsChangeBroadcaster.hpp> #include <cppuhelper/compbase12.hxx> +#include <comphelper/interfacecontainer2.hxx> #include <connectivity/paramwrapper.hxx> #include <connectivity/FValue.hxx> #include <connectivity/warningscontainer.hxx> @@ -91,9 +92,9 @@ namespace dbaccess ::std::vector<bool> m_aParametersSet; ::std::vector<bool> m_aReadOnlyDataColumns; - ::cppu::OInterfaceContainerHelper m_aRowsetListeners; - ::cppu::OInterfaceContainerHelper m_aApproveListeners; - ::cppu::OInterfaceContainerHelper m_aRowsChangeListener; + ::comphelper::OInterfaceContainerHelper2 m_aRowsetListeners; + ::comphelper::OInterfaceContainerHelper2 m_aApproveListeners; + ::comphelper::OInterfaceContainerHelper2 m_aRowsChangeListener; ::dbtools::WarningsContainer m_aWarnings; diff --git a/dbaccess/source/core/dataaccess/bookmarkcontainer.cxx b/dbaccess/source/core/dataaccess/bookmarkcontainer.cxx index a7490bd7cd01..173ed8866437 100644 --- a/dbaccess/source/core/dataaccess/bookmarkcontainer.cxx +++ b/dbaccess/source/core/dataaccess/bookmarkcontainer.cxx @@ -107,7 +107,7 @@ void SAL_CALL OBookmarkContainer::insertByName( const OUString& _rName, const An if (m_aContainerListeners.getLength()) { ContainerEvent aEvent(*this, makeAny(_rName), makeAny(sNewLink), Any()); - OInterfaceIteratorHelper aListenerIterator(m_aContainerListeners); + OInterfaceIteratorHelper2 aListenerIterator(m_aContainerListeners); while (aListenerIterator.hasMoreElements()) static_cast< XContainerListener* >(aListenerIterator.next())->elementInserted(aEvent); } @@ -137,7 +137,7 @@ void SAL_CALL OBookmarkContainer::removeByName( const OUString& _rName ) throw(N if (m_aContainerListeners.getLength()) { ContainerEvent aEvent(*this, makeAny(_rName), makeAny(sOldBookmark), Any()); - OInterfaceIteratorHelper aListenerIterator(m_aContainerListeners); + OInterfaceIteratorHelper2 aListenerIterator(m_aContainerListeners); while (aListenerIterator.hasMoreElements()) static_cast< XContainerListener* >(aListenerIterator.next())->elementRemoved(aEvent); } @@ -172,7 +172,7 @@ void SAL_CALL OBookmarkContainer::replaceByName( const OUString& _rName, const A if (m_aContainerListeners.getLength()) { ContainerEvent aEvent(*this, makeAny(_rName), makeAny(sNewLink), makeAny(sOldLink)); - OInterfaceIteratorHelper aListenerIterator(m_aContainerListeners); + OInterfaceIteratorHelper2 aListenerIterator(m_aContainerListeners); while (aListenerIterator.hasMoreElements()) static_cast< XContainerListener* >(aListenerIterator.next())->elementReplaced(aEvent); } diff --git a/dbaccess/source/core/dataaccess/bookmarkcontainer.hxx b/dbaccess/source/core/dataaccess/bookmarkcontainer.hxx index d1e2f4df4ee7..63a99c9e91dc 100644 --- a/dbaccess/source/core/dataaccess/bookmarkcontainer.hxx +++ b/dbaccess/source/core/dataaccess/bookmarkcontainer.hxx @@ -25,7 +25,7 @@ #include <map> #include <vector> -#include <cppuhelper/interfacecontainer.hxx> +#include <comphelper/interfacecontainer2.hxx> #include <cppuhelper/implbase.hxx> #include <osl/mutex.hxx> #include <com/sun/star/container/XChild.hpp> @@ -64,7 +64,7 @@ protected: protected: ::cppu::OWeakObject& m_rParent; // for the ref counting - ::cppu::OInterfaceContainerHelper + ::comphelper::OInterfaceContainerHelper2 m_aContainerListeners; ::osl::Mutex& m_rMutex; diff --git a/dbaccess/source/core/dataaccess/databasecontext.hxx b/dbaccess/source/core/dataaccess/databasecontext.hxx index cf862300d378..1eb7233b7821 100644 --- a/dbaccess/source/core/dataaccess/databasecontext.hxx +++ b/dbaccess/source/core/dataaccess/databasecontext.hxx @@ -106,7 +106,7 @@ protected: // recreated afterwards. So it's our (the context's) responsibility to store the session-persistent // properties. - ::cppu::OInterfaceContainerHelper m_aContainerListeners; + ::comphelper::OInterfaceContainerHelper2 m_aContainerListeners; DatabaseDocumentLoader* m_pDatabaseDocumentLoader; public: diff --git a/dbaccess/source/core/dataaccess/databasedocument.hxx b/dbaccess/source/core/dataaccess/databasedocument.hxx index 89d1b171e457..06f2c6a232ba 100644 --- a/dbaccess/source/core/dataaccess/databasedocument.hxx +++ b/dbaccess/source/core/dataaccess/databasedocument.hxx @@ -165,9 +165,9 @@ class ODatabaseDocument :public ModelDependentComponent // ModelDepe typedef std::map< OUString, css::uno::Reference< css::frame::XUntitledNumbers > > TNumberedController; css::uno::Reference< css::ui::XUIConfigurationManager2> m_xUIConfigurationManager; - ::cppu::OInterfaceContainerHelper m_aModifyListeners; - ::cppu::OInterfaceContainerHelper m_aCloseListener; - ::cppu::OInterfaceContainerHelper m_aStorageListeners; + ::comphelper::OInterfaceContainerHelper2 m_aModifyListeners; + ::comphelper::OInterfaceContainerHelper2 m_aCloseListener; + ::comphelper::OInterfaceContainerHelper2 m_aStorageListeners; DocumentEvents* m_pEventContainer; ::rtl::Reference< DocumentEventExecutor > m_pEventExecutor; diff --git a/dbaccess/source/core/dataaccess/databaseregistrations.cxx b/dbaccess/source/core/dataaccess/databaseregistrations.cxx index e132fbe786b8..3a6aac442967 100644 --- a/dbaccess/source/core/dataaccess/databaseregistrations.cxx +++ b/dbaccess/source/core/dataaccess/databaseregistrations.cxx @@ -20,7 +20,7 @@ #include <com/sun/star/sdb/XDatabaseRegistrations.hpp> #include <cppuhelper/basemutex.hxx> -#include <cppuhelper/interfacecontainer.hxx> +#include <comphelper/interfacecontainer2.hxx> #include <cppuhelper/implbase1.hxx> #include <rtl/ustrbuf.hxx> #include <unotools/pathoptions.hxx> @@ -134,7 +134,7 @@ namespace dbaccess private: Reference<XComponentContext> m_aContext; ::utl::OConfigurationTreeRoot m_aConfigurationRoot; - ::cppu::OInterfaceContainerHelper m_aRegistrationListeners; + ::comphelper::OInterfaceContainerHelper2 m_aRegistrationListeners; }; // DatabaseRegistrations - implementation diff --git a/dbaccess/source/core/dataaccess/datasource.hxx b/dbaccess/source/core/dataaccess/datasource.hxx index 446b846fbd7a..5c898ae6ea96 100644 --- a/dbaccess/source/core/dataaccess/datasource.hxx +++ b/dbaccess/source/core/dataaccess/datasource.hxx @@ -83,7 +83,7 @@ class ODatabaseSource :public ModelDependentComponent // must be first private: using ODatabaseSource_Base::rBHelper; css::uno::Reference<OBookmarkContainer> m_xBookmarks; - ::cppu::OInterfaceContainerHelper m_aFlushListeners; + ::comphelper::OInterfaceContainerHelper2 m_aFlushListeners; private: virtual ~ODatabaseSource(); diff --git a/dbaccess/source/core/dataaccess/definitioncontainer.cxx b/dbaccess/source/core/dataaccess/definitioncontainer.cxx index fc601b4fccf8..8535b30fa271 100644 --- a/dbaccess/source/core/dataaccess/definitioncontainer.cxx +++ b/dbaccess/source/core/dataaccess/definitioncontainer.cxx @@ -289,7 +289,7 @@ void ODefinitionContainer::notifyByName( ResettableMutexGuard& _rGuard, const OU { bool bApprove = ( _eType == ApproveListeners ); - ::cppu::OInterfaceContainerHelper& rContainer( bApprove ? m_aApproveListeners : m_aContainerListeners ); + ::comphelper::OInterfaceContainerHelper2& rContainer( bApprove ? m_aApproveListeners : m_aContainerListeners ); if ( !rContainer.getLength() ) return; diff --git a/dbaccess/source/core/dataaccess/documenteventnotifier.cxx b/dbaccess/source/core/dataaccess/documenteventnotifier.cxx index 2dd4838e2893..b6858068500e 100644 --- a/dbaccess/source/core/dataaccess/documenteventnotifier.cxx +++ b/dbaccess/source/core/dataaccess/documenteventnotifier.cxx @@ -22,7 +22,7 @@ #include <com/sun/star/frame/DoubleInitializationException.hpp> #include <comphelper/asyncnotification.hxx> -#include <cppuhelper/interfacecontainer.hxx> +#include <comphelper/interfacecontainer2.hxx> #include <cppuhelper/weak.hxx> #include <tools/diagnose_ex.h> @@ -59,8 +59,8 @@ namespace dbaccess bool m_bInitialized; bool m_bDisposed; ::rtl::Reference< ::comphelper::AsyncEventNotifier > m_pEventBroadcaster; - ::cppu::OInterfaceContainerHelper m_aLegacyEventListeners; - ::cppu::OInterfaceContainerHelper m_aDocumentEventListeners; + ::comphelper::OInterfaceContainerHelper2 m_aLegacyEventListeners; + ::comphelper::OInterfaceContainerHelper2 m_aDocumentEventListeners; public: DocumentEventNotifier_Impl( ::cppu::OWeakObject& _rBroadcasterDocument, ::osl::Mutex& _rMutex ) diff --git a/dbaccess/source/core/dataaccess/intercept.hxx b/dbaccess/source/core/dataaccess/intercept.hxx index 6d80e4f444eb..fb4c4230d2a2 100644 --- a/dbaccess/source/core/dataaccess/intercept.hxx +++ b/dbaccess/source/core/dataaccess/intercept.hxx @@ -131,7 +131,7 @@ private: css::uno::Sequence< OUString > m_aInterceptedURL; - cppu::OInterfaceContainerHelper* m_pDisposeEventListeners; + comphelper::OInterfaceContainerHelper2* m_pDisposeEventListeners; PropertyChangeListenerContainer* m_pStatCL; }; diff --git a/dbaccess/source/core/inc/ContentHelper.hxx b/dbaccess/source/core/inc/ContentHelper.hxx index 3e5c74e5de77..768b4b92e4ad 100644 --- a/dbaccess/source/core/inc/ContentHelper.hxx +++ b/dbaccess/source/core/inc/ContentHelper.hxx @@ -32,6 +32,7 @@ #include <com/sun/star/embed/XEmbeddedObject.hpp> #include <com/sun/star/lang/XUnoTunnel.hpp> #include <cppuhelper/compbase.hxx> +#include <comphelper/interfacecontainer2.hxx> #include <comphelper/broadcasthelper.hxx> #include <comphelper/uno3.hxx> #include <com/sun/star/beans/Property.hpp> @@ -101,7 +102,7 @@ namespace dbaccess void impl_rename_throw(const OUString& _sNewName,bool _bNotify = true); protected: - ::cppu::OInterfaceContainerHelper m_aContentListeners; + ::comphelper::OInterfaceContainerHelper2 m_aContentListeners; PropertyChangeListenerContainer m_aPropertyChangeListeners; css::uno::Reference< css::uno::XInterface > m_xParentContainer; diff --git a/dbaccess/source/core/inc/definitioncontainer.hxx b/dbaccess/source/core/inc/definitioncontainer.hxx index 1f7c594b3593..bdefec380f7b 100644 --- a/dbaccess/source/core/inc/definitioncontainer.hxx +++ b/dbaccess/source/core/inc/definitioncontainer.hxx @@ -120,9 +120,9 @@ protected: DocumentsIndexAccess m_aDocuments; // for a efficient index access Documents m_aDocumentMap; // for a efficient name access - ::cppu::OInterfaceContainerHelper + ::comphelper::OInterfaceContainerHelper2 m_aApproveListeners; - ::cppu::OInterfaceContainerHelper + ::comphelper::OInterfaceContainerHelper2 m_aContainerListeners; bool m_bInPropertyChange; diff --git a/dbaccess/source/ui/app/AppController.cxx b/dbaccess/source/ui/app/AppController.cxx index 5d1d893e3775..3a391f509762 100644 --- a/dbaccess/source/ui/app/AppController.cxx +++ b/dbaccess/source/ui/app/AppController.cxx @@ -187,7 +187,7 @@ Reference< XInterface > SAL_CALL OApplicationController::Create(const Reference< class SelectionNotifier : public ::boost::noncopyable { private: - ::cppu::OInterfaceContainerHelper m_aSelectionListeners; + ::comphelper::OInterfaceContainerHelper2 m_aSelectionListeners; ::cppu::OWeakObject& m_rContext; sal_Int32 m_nSelectionNestingLevel; @@ -2340,7 +2340,7 @@ IController& OApplicationController::getCommandController() return *this; } -::cppu::OInterfaceContainerHelper* OApplicationController::getContextMenuInterceptors() +::comphelper::OInterfaceContainerHelper2* OApplicationController::getContextMenuInterceptors() { return &m_aContextMenuInterceptors; } diff --git a/dbaccess/source/ui/app/AppController.hxx b/dbaccess/source/ui/app/AppController.hxx index 7da651439903..e73f1eab3f7c 100644 --- a/dbaccess/source/ui/app/AppController.hxx +++ b/dbaccess/source/ui/app/AppController.hxx @@ -38,6 +38,7 @@ #include <comphelper/namedvaluecollection.hxx> #include <comphelper/uno3.hxx> #include <cppuhelper/implbase5.hxx> +#include <comphelper/interfacecontainer2.hxx> #include <sot/storage.hxx> #include <svtools/transfer.hxx> #include <svx/dataaccessdescriptor.hxx> @@ -99,7 +100,7 @@ namespace dbaui m_xDataSource; css::uno::Reference< css::frame::XModel > m_xModel; - ::cppu::OInterfaceContainerHelper + ::comphelper::OInterfaceContainerHelper2 m_aContextMenuInterceptors; TContainerVector m_aCurrentContainers; // the containers where we are listener on @@ -536,7 +537,7 @@ namespace dbaui // IContextMenuProvider virtual PopupMenu* getContextMenu( Control& _rControl ) const override; virtual IController& getCommandController() override; - virtual ::cppu::OInterfaceContainerHelper* + virtual ::comphelper::OInterfaceContainerHelper2* getContextMenuInterceptors() override; virtual css::uno::Any getCurrentSelection( Control& _rControl ) const override; diff --git a/dbaccess/source/ui/browser/brwctrlr.cxx b/dbaccess/source/ui/browser/brwctrlr.cxx index 36425d0f9c7f..f47a075fa737 100644 --- a/dbaccess/source/ui/browser/brwctrlr.cxx +++ b/dbaccess/source/ui/browser/brwctrlr.cxx @@ -154,7 +154,7 @@ class SbaXDataBrowserController::FormControllerImpl css::frame::XFrameActionListener > { friend class SbaXDataBrowserController; - ::cppu::OInterfaceContainerHelper m_aActivateListeners; + ::comphelper::OInterfaceContainerHelper2 m_aActivateListeners; SbaXDataBrowserController* m_pOwner; public: @@ -935,7 +935,7 @@ void SAL_CALL SbaXDataBrowserController::focusGained(const FocusEvent& /*e*/) th { // notify our activate listeners (registered on the form controller aggregate) EventObject aEvt(*this); - ::cppu::OInterfaceIteratorHelper aIter(m_pFormControllerImpl->m_aActivateListeners); + ::comphelper::OInterfaceIteratorHelper2 aIter(m_pFormControllerImpl->m_aActivateListeners); while (aIter.hasMoreElements()) static_cast<XFormControllerListener*>(aIter.next())->formActivated(aEvt); } @@ -961,7 +961,7 @@ void SAL_CALL SbaXDataBrowserController::focusLost(const FocusEvent& e) throw( R // notify the listeners that the "form" we represent has been deactivated EventObject aEvt(*this); - ::cppu::OInterfaceIteratorHelper aIter(m_pFormControllerImpl->m_aActivateListeners); + ::comphelper::OInterfaceIteratorHelper2 aIter(m_pFormControllerImpl->m_aActivateListeners); while (aIter.hasMoreElements()) static_cast<XFormControllerListener*>(aIter.next())->formDeactivated(aEvt); diff --git a/dbaccess/source/ui/browser/exsrcbrw.cxx b/dbaccess/source/ui/browser/exsrcbrw.cxx index c3d2195a2262..e840504dcf34 100644 --- a/dbaccess/source/ui/browser/exsrcbrw.cxx +++ b/dbaccess/source/ui/browser/exsrcbrw.cxx @@ -123,7 +123,7 @@ void SbaExternalSourceBrowser::modified(const css::lang::EventObject& aEvent) th // multiplex this event to all my listeners css::lang::EventObject aEvt(*this); - ::cppu::OInterfaceIteratorHelper aIt(m_aModifyListeners); + ::comphelper::OInterfaceIteratorHelper2 aIt(m_aModifyListeners); while (aIt.hasMoreElements()) static_cast< css::util::XModifyListener*>(aIt.next())->modified(aEvt); } diff --git a/dbaccess/source/ui/browser/formadapter.cxx b/dbaccess/source/ui/browser/formadapter.cxx index a25eefce39d5..49a6a3030f1d 100644 --- a/dbaccess/source/ui/browser/formadapter.cxx +++ b/dbaccess/source/ui/browser/formadapter.cxx @@ -168,7 +168,7 @@ void SbaXFormAdapter::AttachForm(const Reference< css::sdbc::XRowSet >& xNewMast if (xLoadable->isLoaded()) { css::lang::EventObject aEvt(*this); - ::cppu::OInterfaceIteratorHelper aIt(m_aLoadListeners); + ::comphelper::OInterfaceIteratorHelper2 aIt(m_aLoadListeners); while (aIt.hasMoreElements()) static_cast< css::form::XLoadListener*>(aIt.next())->unloaded(aEvt); } @@ -185,7 +185,7 @@ void SbaXFormAdapter::AttachForm(const Reference< css::sdbc::XRowSet >& xNewMast if (xLoadable->isLoaded()) { css::lang::EventObject aEvt(*this); - ::cppu::OInterfaceIteratorHelper aIt(m_aLoadListeners); + ::comphelper::OInterfaceIteratorHelper2 aIt(m_aLoadListeners); while (aIt.hasMoreElements()) static_cast< css::form::XLoadListener*>(aIt.next())->loaded(aEvt); } @@ -1421,7 +1421,7 @@ void SbaXFormAdapter::implInsert(const Any& aElement, sal_Int32 nIndex, const OU aEvt.Source = *this; aEvt.Accessor <<= nIndex; aEvt.Element <<= xElement; - ::cppu::OInterfaceIteratorHelper aIt(m_aContainerListeners); + ::comphelper::OInterfaceIteratorHelper2 aIt(m_aContainerListeners); while (aIt.hasMoreElements()) static_cast< css::container::XContainerListener*>(aIt.next())->elementInserted(aEvt); } @@ -1526,7 +1526,7 @@ void SAL_CALL SbaXFormAdapter::removeByIndex(sal_Int32 _rIndex) throw( css::lang css::container::ContainerEvent aEvt; aEvt.Source = *this; aEvt.Element <<= xAffected; - ::cppu::OInterfaceIteratorHelper aIt(m_aContainerListeners); + ::comphelper::OInterfaceIteratorHelper2 aIt(m_aContainerListeners); while (aIt.hasMoreElements()) static_cast< css::container::XContainerListener*>(aIt.next())->elementRemoved(aEvt); @@ -1589,7 +1589,7 @@ void SAL_CALL SbaXFormAdapter::replaceByIndex(sal_Int32 _rIndex, const Any& Elem aEvt.Element <<= xElement; aEvt.ReplacedElement <<= xOld; - ::cppu::OInterfaceIteratorHelper aIt(m_aContainerListeners); + ::comphelper::OInterfaceIteratorHelper2 aIt(m_aContainerListeners); while (aIt.hasMoreElements()) static_cast< css::container::XContainerListener*>(aIt.next())->elementReplaced(aEvt); } diff --git a/dbaccess/source/ui/browser/sbamultiplex.cxx b/dbaccess/source/ui/browser/sbamultiplex.cxx index 309dba915d1d..2220eceba2e2 100644 --- a/dbaccess/source/ui/browser/sbamultiplex.cxx +++ b/dbaccess/source/ui/browser/sbamultiplex.cxx @@ -29,7 +29,7 @@ void SAL_CALL SbaXStatusMultiplexer::statusChanged(const css::frame::FeatureStat { m_aLastKnownStatus = e; m_aLastKnownStatus.Source = &m_rParent; - ::cppu::OInterfaceIteratorHelper aIt( *this ); + ::comphelper::OInterfaceIteratorHelper2 aIt( *this ); while ( aIt.hasMoreElements() ) static_cast< css::frame::XStatusListener* >( aIt.next() )->statusChanged( m_aLastKnownStatus ); } \ @@ -89,7 +89,7 @@ void SbaXPropertiesChangeMultiplexer::propertiesChange(const css::uno::Sequence< for (sal_Int32 i=0; i<aMulti.getLength(); ++i, ++pMulti) pMulti->Source = &m_rParent; - ::cppu::OInterfaceIteratorHelper aIt(*this); + ::comphelper::OInterfaceIteratorHelper2 aIt(*this); while (aIt.hasMoreElements()) static_cast< css::beans::XPropertiesChangeListener*>(aIt.next())->propertiesChange(aMulti); } diff --git a/dbaccess/source/ui/browser/unodatbr.cxx b/dbaccess/source/ui/browser/unodatbr.cxx index 30cff7ef186e..a19442d3200f 100644 --- a/dbaccess/source/ui/browser/unodatbr.cxx +++ b/dbaccess/source/ui/browser/unodatbr.cxx @@ -3491,7 +3491,7 @@ IController& SbaTableQueryBrowser::getCommandController() return *this; } -::cppu::OInterfaceContainerHelper* SbaTableQueryBrowser::getContextMenuInterceptors() +::comphelper::OInterfaceContainerHelper2* SbaTableQueryBrowser::getContextMenuInterceptors() { return &m_aContextMenuInterceptors; } diff --git a/dbaccess/source/ui/control/dbtreelistbox.cxx b/dbaccess/source/ui/control/dbtreelistbox.cxx index d27560190b99..7142e295d8e0 100644 --- a/dbaccess/source/ui/control/dbtreelistbox.cxx +++ b/dbaccess/source/ui/control/dbtreelistbox.cxx @@ -29,7 +29,7 @@ #include <com/sun/star/frame/XFrame.hpp> #include <com/sun/star/util/URL.hpp> #include <cppuhelper/implbase.hxx> -#include <cppuhelper/interfacecontainer.hxx> +#include <comphelper/interfacecontainer2.hxx> #include <vcl/help.hxx> #include <vcl/commandinfoprovider.hxx> #include <dbaccess/IController.hxx> @@ -565,7 +565,7 @@ std::unique_ptr<PopupMenu> DBTreeListBox::CreateContextMenu() // set images lcl_insertMenuItemImages( *pContextMenu, m_pContextMenuProvider->getCommandController() ); // allow context menu interception - ::cppu::OInterfaceContainerHelper* pInterceptors = m_pContextMenuProvider->getContextMenuInterceptors(); + ::comphelper::OInterfaceContainerHelper2* pInterceptors = m_pContextMenuProvider->getContextMenuInterceptors(); if ( !pInterceptors || !pInterceptors->getLength() ) return pContextMenu; @@ -577,7 +577,7 @@ std::unique_ptr<PopupMenu> DBTreeListBox::CreateContextMenu() pContextMenu.get(), nullptr ); aEvent.Selection = new SelectionSupplier( m_pContextMenuProvider->getCurrentSelection( *this ) ); - ::cppu::OInterfaceIteratorHelper aIter( *pInterceptors ); + ::comphelper::OInterfaceIteratorHelper2 aIter( *pInterceptors ); bool bModifiedMenu = false; bool bAskInterceptors = true; while ( aIter.hasMoreElements() && bAskInterceptors ) diff --git a/dbaccess/source/ui/inc/callbacks.hxx b/dbaccess/source/ui/inc/callbacks.hxx index a87ccf374dd9..9c2a579a7a51 100644 --- a/dbaccess/source/ui/inc/callbacks.hxx +++ b/dbaccess/source/ui/inc/callbacks.hxx @@ -31,7 +31,7 @@ class Control; struct AcceptDropEvent; struct ExecuteDropEvent; -namespace cppu { class OInterfaceContainerHelper; } +namespace comphelper { class OInterfaceContainerHelper2; } namespace dbaui { @@ -84,7 +84,7 @@ namespace dbaui /** returns the container of registered context menu interceptors, or NULL if the implementation does not support context menu interception */ - virtual ::cppu::OInterfaceContainerHelper* + virtual ::comphelper::OInterfaceContainerHelper2* getContextMenuInterceptors() = 0; /** returns the current selection in the given control diff --git a/dbaccess/source/ui/inc/exsrcbrw.hxx b/dbaccess/source/ui/inc/exsrcbrw.hxx index 09c0ea6a6fe9..3a533e8fadf4 100644 --- a/dbaccess/source/ui/inc/exsrcbrw.hxx +++ b/dbaccess/source/ui/inc/exsrcbrw.hxx @@ -34,7 +34,7 @@ namespace dbaui :public SbaXDataBrowserController ,public css::util::XModifyBroadcaster { - ::cppu::OInterfaceContainerHelper m_aModifyListeners; + ::comphelper::OInterfaceContainerHelper2 m_aModifyListeners; // for multiplexing the modify events SbaXFormAdapter* m_pDataSourceImpl; bool m_bInQueryDispatch; diff --git a/dbaccess/source/ui/inc/formadapter.hxx b/dbaccess/source/ui/inc/formadapter.hxx index 82eb85c7b730..c9d7093db9de 100644 --- a/dbaccess/source/ui/inc/formadapter.hxx +++ b/dbaccess/source/ui/inc/formadapter.hxx @@ -136,8 +136,8 @@ namespace dbaui SbaXVetoableChangeMultiplexer m_aVetoablePropertyChangeListeners; SbaXPropertiesChangeMultiplexer m_aPropertiesChangeListeners; - ::cppu::OInterfaceContainerHelper m_aDisposeListeners; - ::cppu::OInterfaceContainerHelper m_aContainerListeners; + ::comphelper::OInterfaceContainerHelper2 m_aDisposeListeners; + ::comphelper::OInterfaceContainerHelper2 m_aContainerListeners; // hierarchy administration css::uno::Reference< css::uno::XInterface > m_xParent; diff --git a/dbaccess/source/ui/inc/sbamultiplex.hxx b/dbaccess/source/ui/inc/sbamultiplex.hxx index c5b097de4db0..67999030cb4d 100644 --- a/dbaccess/source/ui/inc/sbamultiplex.hxx +++ b/dbaccess/source/ui/inc/sbamultiplex.hxx @@ -41,6 +41,7 @@ #include <com/sun/star/frame/XStatusListener.hpp> #include <comphelper/uno3.hxx> #include <cppuhelper/interfacecontainer.hxx> +#include <comphelper/interfacecontainer2.hxx> #include <cppuhelper/queryinterface.hxx> #include <cppuhelper/weak.hxx> @@ -64,7 +65,7 @@ namespace dbaui class classname \ :public OSbaWeakSubObject \ ,public listenerclass \ - ,public ::cppu::OInterfaceContainerHelper \ + ,public ::comphelper::OInterfaceContainerHelper2 \ { \ public: \ classname( ::cppu::OWeakObject& rSource, \ @@ -83,7 +84,7 @@ namespace dbaui virtual sal_Bool SAL_CALL methodname(const eventtype& e) throw (css::uno::RuntimeException, std::exception) override; \ #define END_DECLARE_LISTENER_MULTIPLEXER() \ - /* 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 OSbaWeakSubObject::operator new(size); } \ void SAL_CALL operator delete( void * p ) throw() { OSbaWeakSubObject::operator delete(p); } \ }; \ @@ -94,7 +95,7 @@ namespace dbaui \ classname::classname(::cppu::OWeakObject& rSource, ::osl::Mutex& _rMutex) \ :OSbaWeakSubObject(rSource) \ - ,OInterfaceContainerHelper(_rMutex) \ + ,OInterfaceContainerHelper2(_rMutex) \ { \ } \ \ @@ -120,7 +121,7 @@ namespace dbaui { \ eventtype aMulti(e); \ aMulti.Source = &m_rParent; \ - ::cppu::OInterfaceIteratorHelper aIt(*this); \ + ::comphelper::OInterfaceIteratorHelper2 aIt(*this); \ while (aIt.hasMoreElements()) \ static_cast< listenerclass*>(aIt.next())->methodname(aMulti); \ } \ @@ -130,7 +131,7 @@ namespace dbaui { \ eventtype aMulti(e); \ aMulti.Source = &m_rParent; \ - ::cppu::OInterfaceIteratorHelper aIt(*this); \ + ::comphelper::OInterfaceIteratorHelper2 aIt(*this); \ bool bResult = true; \ while (bResult && aIt.hasMoreElements()) \ bResult = static_cast< listenerclass*>(aIt.next())->methodname(aMulti); \ diff --git a/dbaccess/source/ui/inc/unodatbr.hxx b/dbaccess/source/ui/inc/unodatbr.hxx index 4c58d72c2463..c70fa481c47b 100644 --- a/dbaccess/source/ui/inc/unodatbr.hxx +++ b/dbaccess/source/ui/inc/unodatbr.hxx @@ -91,8 +91,8 @@ namespace dbaui svx::ODataAccessDescriptor m_aDocumentDataSource; // if we're part of a document, this is the state of the DocumentDataSource slot - ::cppu::OInterfaceContainerHelper m_aSelectionListeners; - ::cppu::OInterfaceContainerHelper m_aContextMenuInterceptors; + ::comphelper::OInterfaceContainerHelper2 m_aSelectionListeners; + ::comphelper::OInterfaceContainerHelper2 m_aContextMenuInterceptors; OTableCopyHelper::DropDescriptor m_aAsyncDrop; OTableCopyHelper m_aTableCopyHelper; @@ -232,7 +232,7 @@ namespace dbaui // IContextMenuProvider virtual PopupMenu* getContextMenu( Control& _rControl ) const override; virtual IController& getCommandController() override; - virtual ::cppu::OInterfaceContainerHelper* + virtual ::comphelper::OInterfaceContainerHelper2* getContextMenuInterceptors() override; virtual css::uno::Any getCurrentSelection( Control& _rControl ) const override; diff --git a/dbaccess/source/ui/misc/dbsubcomponentcontroller.cxx b/dbaccess/source/ui/misc/dbsubcomponentcontroller.cxx index 1e14c3f75d03..70154bbfcf18 100644 --- a/dbaccess/source/ui/misc/dbsubcomponentcontroller.cxx +++ b/dbaccess/source/ui/misc/dbsubcomponentcontroller.cxx @@ -41,6 +41,7 @@ #include <connectivity/dbexception.hxx> #include <connectivity/dbtools.hxx> #include <cppuhelper/typeprovider.hxx> +#include <comphelper/interfacecontainer2.hxx> #include <rtl/ustrbuf.hxx> #include <toolkit/helper/vclunohelper.hxx> #include <tools/debug.hxx> @@ -126,7 +127,7 @@ namespace dbaui OModuleClient m_aModuleClient; ::dbtools::SQLExceptionInfo m_aCurrentError; - ::cppu::OInterfaceContainerHelper + ::comphelper::OInterfaceContainerHelper2 m_aModifyListeners; // <properties> diff --git a/dbaccess/source/ui/uno/copytablewizard.cxx b/dbaccess/source/ui/uno/copytablewizard.cxx index bdfd531da0aa..5030eeb3995a 100644 --- a/dbaccess/source/ui/uno/copytablewizard.cxx +++ b/dbaccess/source/ui/uno/copytablewizard.cxx @@ -64,6 +64,7 @@ #include <connectivity/dbtools.hxx> #include <cppuhelper/exc_hlp.hxx> #include <cppuhelper/implbase.hxx> +#include <comphelper/interfacecontainer2.hxx> #include <rtl/ustrbuf.hxx> #include <svtools/genericunodialog.hxx> #include <tools/diagnose_ex.h> @@ -346,7 +347,7 @@ private: // other Reference< XInteractionHandler > m_xInteractionHandler; - ::cppu::OInterfaceContainerHelper + ::comphelper::OInterfaceContainerHelper2 m_aCopyTableListeners; sal_Int16 m_nOverrideExecutionResult; }; @@ -1016,7 +1017,7 @@ bool CopyTableWizard::impl_processCopyError_nothrow( const CopyTableRowEvent& _r Reference< XCopyTableListener > xListener; try { - ::cppu::OInterfaceIteratorHelper aIter( m_aCopyTableListeners ); + ::comphelper::OInterfaceIteratorHelper2 aIter( m_aCopyTableListeners ); while ( aIter.hasMoreElements() ) { xListener.set( aIter.next(), UNO_QUERY_THROW ); |