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 --- forms/source/component/Button.cxx | 2 +- forms/source/component/DatabaseForm.cxx | 12 ++++++------ forms/source/component/DatabaseForm.hxx | 8 ++++---- forms/source/component/Edit.hxx | 2 +- forms/source/component/File.cxx | 2 +- forms/source/component/File.hxx | 2 +- forms/source/component/Filter.cxx | 4 ++-- forms/source/component/FormComponent.cxx | 2 +- forms/source/component/Grid.cxx | 2 +- forms/source/component/Grid.hxx | 2 +- forms/source/component/ImageControl.hxx | 2 +- forms/source/component/ListBox.hxx | 4 ++-- forms/source/component/clickableimage.cxx | 2 +- forms/source/component/clickableimage.hxx | 6 +++--- forms/source/component/entrylisthelper.hxx | 4 ++-- forms/source/component/errorbroadcaster.cxx | 2 +- forms/source/component/errorbroadcaster.hxx | 5 +++-- forms/source/helper/resettable.cxx | 2 +- forms/source/inc/FormComponent.hxx | 4 ++-- forms/source/inc/InterfaceContainer.hxx | 4 ++-- forms/source/inc/resettable.hxx | 4 ++-- forms/source/misc/InterfaceContainer.cxx | 2 +- forms/source/richtext/attributedispatcher.cxx | 2 +- forms/source/richtext/featuredispatcher.cxx | 2 +- forms/source/richtext/featuredispatcher.hxx | 6 +++--- forms/source/richtext/richtextmodel.hxx | 2 +- 26 files changed, 46 insertions(+), 45 deletions(-) (limited to 'forms') diff --git a/forms/source/component/Button.cxx b/forms/source/component/Button.cxx index 09c676ebe844..e49b950a6ffd 100644 --- a/forms/source/component/Button.cxx +++ b/forms/source/component/Button.cxx @@ -448,7 +448,7 @@ IMPL_LINK_NOARG_TYPED(OButtonControl, OnClick, void*, void) if (FormButtonType_PUSH == *static_cast(xSet->getPropertyValue(PROPERTY_BUTTONTYPE).getValue())) { // notify the action listeners for a push button - ::cppu::OInterfaceIteratorHelper aIter(m_aActionListeners); + ::comphelper::OInterfaceIteratorHelper2 aIter(m_aActionListeners); ActionEvent aEvt(static_cast(this), m_aActionCommand); while(aIter.hasMoreElements() ) { diff --git a/forms/source/component/DatabaseForm.cxx b/forms/source/component/DatabaseForm.cxx index 60228c6c5a17..3f122a9fd5db 100644 --- a/forms/source/component/DatabaseForm.cxx +++ b/forms/source/component/DatabaseForm.cxx @@ -2151,7 +2151,7 @@ void ODatabaseForm::submit_impl(const Reference& Control, const css::a if (_bAproveByListeners) { - ::cppu::OInterfaceIteratorHelper aIter(m_aSubmitListeners); + ::comphelper::OInterfaceIteratorHelper2 aIter(m_aSubmitListeners); EventObject aEvt(static_cast(this)); bool bCanceled = false; while (aIter.hasMoreElements() && !bCanceled) @@ -2944,7 +2944,7 @@ void ODatabaseForm::reload_impl(bool bMoveToFirst, const Reference< XInteraction // the approvement is done by the aggregate if (!m_aRowSetApproveListeners.getLength()) { - ::cppu::OInterfaceIteratorHelper aIter(m_aLoadListeners); + ::comphelper::OInterfaceIteratorHelper2 aIter(m_aLoadListeners); aGuard.clear(); while (aIter.hasMoreElements()) @@ -2967,7 +2967,7 @@ void ODatabaseForm::reload_impl(bool bMoveToFirst, const Reference< XInteraction if (bSuccess) { - ::cppu::OInterfaceIteratorHelper aIter(m_aLoadListeners); + ::comphelper::OInterfaceIteratorHelper2 aIter(m_aLoadListeners); aGuard.clear(); while (aIter.hasMoreElements()) static_cast(aIter.next())->reloaded(aEvent); @@ -3047,7 +3047,7 @@ void SAL_CALL ODatabaseForm::rowSetChanged(const EventObject& /*event*/) throw( bool ODatabaseForm::impl_approveRowChange_throw( const EventObject& _rEvent, const bool _bAllowSQLException, ::osl::ClearableMutexGuard& _rGuard ) { - ::cppu::OInterfaceIteratorHelper aIter( m_aRowSetApproveListeners ); + ::comphelper::OInterfaceIteratorHelper2 aIter( m_aRowSetApproveListeners ); _rGuard.clear(); while ( aIter.hasMoreElements() ) { @@ -3092,7 +3092,7 @@ sal_Bool SAL_CALL ODatabaseForm::approveCursorMove(const EventObject& event) thr // Our aggregate doesn't have any ApproveRowSetListeners (expect ourself), as we re-routed the queryInterface // for XRowSetApproveBroadcaster-interface. // So we have to multiplex this approve request. - ::cppu::OInterfaceIteratorHelper aIter( m_aRowSetApproveListeners ); + ::comphelper::OInterfaceIteratorHelper2 aIter( m_aRowSetApproveListeners ); while ( aIter.hasMoreElements() ) { Reference< XRowSetApproveListener > xListener( static_cast< XRowSetApproveListener* >( aIter.next() ) ); @@ -3141,7 +3141,7 @@ sal_Bool SAL_CALL ODatabaseForm::approveRowChange(const RowChangeEvent& event) t // Our aggregate doesn't have any ApproveRowSetListeners (expect ourself), as we re-routed the queryInterface // for XRowSetApproveBroadcaster-interface. // So we have to multiplex this approve request. - ::cppu::OInterfaceIteratorHelper aIter( m_aRowSetApproveListeners ); + ::comphelper::OInterfaceIteratorHelper2 aIter( m_aRowSetApproveListeners ); while ( aIter.hasMoreElements() ) { Reference< XRowSetApproveListener > xListener( static_cast< XRowSetApproveListener* >( aIter.next() ) ); diff --git a/forms/source/component/DatabaseForm.hxx b/forms/source/component/DatabaseForm.hxx index 570747fc6a46..c15b68d1376b 100644 --- a/forms/source/component/DatabaseForm.hxx +++ b/forms/source/component/DatabaseForm.hxx @@ -160,10 +160,10 @@ class ODatabaseForm :public OFormComponents friend class OFormSubmitResetThread; // listener administration - ::cppu::OInterfaceContainerHelper m_aLoadListeners; - ::cppu::OInterfaceContainerHelper m_aRowSetApproveListeners; - ::cppu::OInterfaceContainerHelper m_aSubmitListeners; - ::cppu::OInterfaceContainerHelper m_aErrorListeners; + ::comphelper::OInterfaceContainerHelper2 m_aLoadListeners; + ::comphelper::OInterfaceContainerHelper2 m_aRowSetApproveListeners; + ::comphelper::OInterfaceContainerHelper2 m_aSubmitListeners; + ::comphelper::OInterfaceContainerHelper2 m_aErrorListeners; ResetListeners m_aResetListeners; ::osl::Mutex m_aResetSafety; css::uno::Any m_aCycle; diff --git a/forms/source/component/Edit.hxx b/forms/source/component/Edit.hxx index 6ed1bcbb6360..8a44722f7ed8 100644 --- a/forms/source/component/Edit.hxx +++ b/forms/source/component/Edit.hxx @@ -124,7 +124,7 @@ typedef ::cppu::ImplHelper3< css::awt::XFocusListener, class OEditControl : public OBoundControl ,public OEditControl_BASE { - ::cppu::OInterfaceContainerHelper + ::comphelper::OInterfaceContainerHelper2 m_aChangeListeners; OUString m_aHtmlChangeValue; diff --git a/forms/source/component/File.cxx b/forms/source/component/File.cxx index 5a8c83df5cf1..cfc85461986f 100644 --- a/forms/source/component/File.cxx +++ b/forms/source/component/File.cxx @@ -238,7 +238,7 @@ void OFileControlModel::read(const Reference& _rxIn void SAL_CALL OFileControlModel::reset() throw ( css::uno::RuntimeException, std::exception) { - ::cppu::OInterfaceIteratorHelper aIter(m_aResetListeners); + ::comphelper::OInterfaceIteratorHelper2 aIter(m_aResetListeners); EventObject aEvt(static_cast(this)); bool bContinue = true; while (aIter.hasMoreElements() && bContinue) diff --git a/forms/source/component/File.hxx b/forms/source/component/File.hxx index 5f36753b7405..04cd3f7e0a5d 100644 --- a/forms/source/component/File.hxx +++ b/forms/source/component/File.hxx @@ -30,7 +30,7 @@ class OFileControlModel :public OControlModel ,public css::form::XReset { - ::cppu::OInterfaceContainerHelper m_aResetListeners; + ::comphelper::OInterfaceContainerHelper2 m_aResetListeners; OUString m_sDefaultValue; protected: diff --git a/forms/source/component/Filter.cxx b/forms/source/component/Filter.cxx index f1a364b17f8d..56a8ec4e3974 100644 --- a/forms/source/component/Filter.cxx +++ b/forms/source/component/Filter.cxx @@ -361,7 +361,7 @@ namespace frm m_aText = sText; TextEvent aEvt; aEvt.Source = *this; - ::cppu::OInterfaceIteratorHelper aIt( m_aTextListeners ); + ::comphelper::OInterfaceIteratorHelper2 aIt( m_aTextListeners ); while( aIt.hasMoreElements() ) static_cast(aIt.next())->textChanged( aEvt ); } @@ -537,7 +537,7 @@ namespace frm setText(aNewText); TextEvent aEvt; aEvt.Source = *this; - ::cppu::OInterfaceIteratorHelper aIt( m_aTextListeners ); + ::comphelper::OInterfaceIteratorHelper2 aIt( m_aTextListeners ); while( aIt.hasMoreElements() ) static_cast< XTextListener* >( aIt.next() )->textChanged( aEvt ); } diff --git a/forms/source/component/FormComponent.cxx b/forms/source/component/FormComponent.cxx index 7d73658a3536..4ffc3dd01745 100644 --- a/forms/source/component/FormComponent.cxx +++ b/forms/source/component/FormComponent.cxx @@ -1883,7 +1883,7 @@ sal_Bool SAL_CALL OBoundControlModel::commit() throw(RuntimeException, std::exce // we reach this only if we're not working with an external binding if ( !hasField() ) return sal_True; - ::cppu::OInterfaceIteratorHelper aIter( m_aUpdateListeners ); + ::comphelper::OInterfaceIteratorHelper2 aIter( m_aUpdateListeners ); EventObject aEvent; aEvent.Source = static_cast< XWeak* >( this ); bool bSuccess = true; diff --git a/forms/source/component/Grid.cxx b/forms/source/component/Grid.cxx index b69582c274e3..ee5a54d25a80 100644 --- a/forms/source/component/Grid.cxx +++ b/forms/source/component/Grid.cxx @@ -349,7 +349,7 @@ css::uno::Sequence SAL_CALL OGridControlModel::getColumnTypes() throw // XReset void SAL_CALL OGridControlModel::reset() throw ( css::uno::RuntimeException, std::exception) { - ::cppu::OInterfaceIteratorHelper aIter(m_aResetListeners); + ::comphelper::OInterfaceIteratorHelper2 aIter(m_aResetListeners); EventObject aEvt(static_cast(this)); bool bContinue = true; while (aIter.hasMoreElements() && bContinue) diff --git a/forms/source/component/Grid.hxx b/forms/source/component/Grid.hxx index 168d524c5aad..2ce689601e24 100644 --- a/forms/source/component/Grid.hxx +++ b/forms/source/component/Grid.hxx @@ -64,7 +64,7 @@ class OGridControlModel :public OControlModel ,public FontControlModel ,public OGridControlModel_BASE { - ::cppu::OInterfaceContainerHelper m_aSelectListeners, + ::comphelper::OInterfaceContainerHelper2 m_aSelectListeners, m_aResetListeners, m_aRowSetChangeListeners; diff --git a/forms/source/component/ImageControl.hxx b/forms/source/component/ImageControl.hxx index 4185e575a0ff..791db89dae3f 100644 --- a/forms/source/component/ImageControl.hxx +++ b/forms/source/component/ImageControl.hxx @@ -150,7 +150,7 @@ class OImageControlControl : public OBoundControl , public OImageControlControl_Base { private: - ::cppu::OInterfaceContainerHelper m_aModifyListeners; + ::comphelper::OInterfaceContainerHelper2 m_aModifyListeners; // XTypeProvider virtual css::uno::Sequence< css::uno::Type> _getTypes() override; diff --git a/forms/source/component/ListBox.hxx b/forms/source/component/ListBox.hxx index ae175a2171d4..702332eaef37 100644 --- a/forms/source/component/ListBox.hxx +++ b/forms/source/component/ListBox.hxx @@ -252,8 +252,8 @@ class OListBoxControl :public OBoundControl ,public IEventProcessor { private: - ::cppu::OInterfaceContainerHelper m_aChangeListeners; - ::cppu::OInterfaceContainerHelper m_aItemListeners; + ::comphelper::OInterfaceContainerHelper2 m_aChangeListeners; + ::comphelper::OInterfaceContainerHelper2 m_aItemListeners; css::uno::Any m_aCurrentSelection; Idle m_aChangeIdle; diff --git a/forms/source/component/clickableimage.cxx b/forms/source/component/clickableimage.cxx index d65267d2f3fd..cfbfa5011eeb 100644 --- a/forms/source/component/clickableimage.cxx +++ b/forms/source/component/clickableimage.cxx @@ -178,7 +178,7 @@ namespace frm bool bCancelled = false; EventObject aEvent( static_cast< XWeak* >( this ) ); - ::cppu::OInterfaceIteratorHelper aIter( m_aApproveActionListeners ); + ::comphelper::OInterfaceIteratorHelper2 aIter( m_aApproveActionListeners ); while( !bCancelled && aIter.hasMoreElements() ) { // Every approveAction method must be thread-safe! diff --git a/forms/source/component/clickableimage.hxx b/forms/source/component/clickableimage.hxx index 78a11bf2f45a..3fd232303677 100644 --- a/forms/source/component/clickableimage.hxx +++ b/forms/source/component/clickableimage.hxx @@ -188,13 +188,13 @@ namespace frm private: OImageProducerThread_Impl* m_pThread; - ::cppu::OInterfaceContainerHelper m_aSubmissionVetoListeners; + ::comphelper::OInterfaceContainerHelper2 m_aSubmissionVetoListeners; ::std::unique_ptr< ControlFeatureInterception > m_pFeatureInterception; protected: - ::cppu::OInterfaceContainerHelper m_aApproveActionListeners; - ::cppu::OInterfaceContainerHelper m_aActionListeners; + ::comphelper::OInterfaceContainerHelper2 m_aApproveActionListeners; + ::comphelper::OInterfaceContainerHelper2 m_aActionListeners; OUString m_aActionCommand; // XSubmission diff --git a/forms/source/component/entrylisthelper.hxx b/forms/source/component/entrylisthelper.hxx index 1e3b14699030..80889887a07a 100644 --- a/forms/source/component/entrylisthelper.hxx +++ b/forms/source/component/entrylisthelper.hxx @@ -26,7 +26,7 @@ #include #include -#include +#include namespace frm @@ -53,7 +53,7 @@ namespace frm m_xListSource; /// our external list source css::uno::Sequence< OUString > m_aStringItems; /// "overridden" StringItemList property value - ::cppu::OInterfaceContainerHelper + ::comphelper::OInterfaceContainerHelper2 m_aRefreshListeners; diff --git a/forms/source/component/errorbroadcaster.cxx b/forms/source/component/errorbroadcaster.cxx index 0e4330ed4db1..e619d0952401 100644 --- a/forms/source/component/errorbroadcaster.cxx +++ b/forms/source/component/errorbroadcaster.cxx @@ -75,7 +75,7 @@ namespace frm if ( m_aErrorListeners.getLength() ) { - ::cppu::OInterfaceIteratorHelper aIter( m_aErrorListeners ); + ::comphelper::OInterfaceIteratorHelper2 aIter( m_aErrorListeners ); while ( aIter.hasMoreElements() ) static_cast< XSQLErrorListener* >( aIter.next() )->errorOccured( _rError ); } diff --git a/forms/source/component/errorbroadcaster.hxx b/forms/source/component/errorbroadcaster.hxx index ec5c4d31859d..f5d036e0ef8c 100644 --- a/forms/source/component/errorbroadcaster.hxx +++ b/forms/source/component/errorbroadcaster.hxx @@ -22,7 +22,8 @@ #include #include -#include +#include +#include #include #include @@ -37,7 +38,7 @@ namespace frm { private: ::cppu::OBroadcastHelper& m_rBHelper; - ::cppu::OInterfaceContainerHelper m_aErrorListeners; + ::comphelper::OInterfaceContainerHelper2 m_aErrorListeners; protected: explicit OErrorBroadcaster( ::cppu::OBroadcastHelper& _rBHelper ); diff --git a/forms/source/helper/resettable.cxx b/forms/source/helper/resettable.cxx index 82dbde227487..de7db34de056 100644 --- a/forms/source/helper/resettable.cxx +++ b/forms/source/helper/resettable.cxx @@ -58,7 +58,7 @@ namespace frm bool ResetHelper::approveReset() { - ::cppu::OInterfaceIteratorHelper aIter( m_aResetListeners ); + ::comphelper::OInterfaceIteratorHelper2 aIter( m_aResetListeners ); EventObject aResetEvent( m_rParent ); bool bContinue = true; diff --git a/forms/source/inc/FormComponent.hxx b/forms/source/inc/FormComponent.hxx index d15b1217eeac..eb5118e89f5f 100644 --- a/forms/source/inc/FormComponent.hxx +++ b/forms/source/inc/FormComponent.hxx @@ -587,8 +587,8 @@ private: bool m_bValuePropertyMayBeVoid; ResetHelper m_aResetHelper; - ::cppu::OInterfaceContainerHelper m_aUpdateListeners; - ::cppu::OInterfaceContainerHelper m_aFormComponentListeners; + ::comphelper::OInterfaceContainerHelper2 m_aUpdateListeners; + ::comphelper::OInterfaceContainerHelper2 m_aFormComponentListeners; css::uno::Reference< css::form::binding::XValueBinding > m_xExternalBinding; diff --git a/forms/source/inc/InterfaceContainer.hxx b/forms/source/inc/InterfaceContainer.hxx index e274ec5e3ea5..a5f319ebe5f7 100644 --- a/forms/source/inc/InterfaceContainer.hxx +++ b/forms/source/inc/InterfaceContainer.hxx @@ -41,7 +41,7 @@ #include #include #include -#include +#include #include #include #include @@ -100,7 +100,7 @@ protected: OInterfaceArray m_aItems; OInterfaceMap m_aMap; - ::cppu::OInterfaceContainerHelper m_aContainerListeners; + ::comphelper::OInterfaceContainerHelper2 m_aContainerListeners; const css::uno::Type m_aElementType; diff --git a/forms/source/inc/resettable.hxx b/forms/source/inc/resettable.hxx index 2a5cb308ad1c..11a2db89777e 100644 --- a/forms/source/inc/resettable.hxx +++ b/forms/source/inc/resettable.hxx @@ -22,7 +22,7 @@ #include -#include +#include namespace cppu { @@ -53,7 +53,7 @@ namespace frm private: ::cppu::OWeakObject& m_rParent; - ::cppu::OInterfaceContainerHelper m_aResetListeners; + ::comphelper::OInterfaceContainerHelper2 m_aResetListeners; }; diff --git a/forms/source/misc/InterfaceContainer.cxx b/forms/source/misc/InterfaceContainer.cxx index 63aee56f9d5d..f78fa967b5a6 100644 --- a/forms/source/misc/InterfaceContainer.cxx +++ b/forms/source/misc/InterfaceContainer.cxx @@ -586,7 +586,7 @@ void SAL_CALL OInterfaceContainer::read( const Reference< XObjectInputStream >& } catch( const Exception& ) { - SAL_WARN("forms.misc", "OInterfaceContainerHelper::read: reading succeeded, but not inserting!" ); + SAL_WARN("forms.misc", "OInterfaceContainerHelper2::read: reading succeeded, but not inserting!" ); // create a placeholder xElement.set(lcl_createPlaceHolder( m_xContext ), css::uno::UNO_QUERY); if ( !xElement.is() ) diff --git a/forms/source/richtext/attributedispatcher.cxx b/forms/source/richtext/attributedispatcher.cxx index 768d3f28becb..abc6ab789283 100644 --- a/forms/source/richtext/attributedispatcher.cxx +++ b/forms/source/richtext/attributedispatcher.cxx @@ -112,7 +112,7 @@ namespace frm (void)_nAttributeId; FeatureStateEvent aEvent( buildStatusEvent() ); - ::cppu::OInterfaceIteratorHelper aIter( getStatusListeners() ); + ::comphelper::OInterfaceIteratorHelper2 aIter( getStatusListeners() ); while ( aIter.hasMoreElements() ) doNotify( static_cast< XStatusListener* >( aIter.next() ), aEvent ); } diff --git a/forms/source/richtext/featuredispatcher.cxx b/forms/source/richtext/featuredispatcher.cxx index 66740eb5afa2..1e0ec84b57db 100644 --- a/forms/source/richtext/featuredispatcher.cxx +++ b/forms/source/richtext/featuredispatcher.cxx @@ -107,7 +107,7 @@ namespace frm void ORichTextFeatureDispatcher::invalidateFeatureState_Broadcast() { FeatureStateEvent aEvent( buildStatusEvent() ); - ::cppu::OInterfaceIteratorHelper aIter( getStatusListeners() ); + ::comphelper::OInterfaceIteratorHelper2 aIter( getStatusListeners() ); while ( aIter.hasMoreElements() ) doNotify( static_cast< XStatusListener* >( aIter.next() ), aEvent ); } diff --git a/forms/source/richtext/featuredispatcher.hxx b/forms/source/richtext/featuredispatcher.hxx index 794947ff0764..b36a563c9d0f 100644 --- a/forms/source/richtext/featuredispatcher.hxx +++ b/forms/source/richtext/featuredispatcher.hxx @@ -22,7 +22,7 @@ #include #include -#include +#include #include #include @@ -39,7 +39,7 @@ namespace frm { private: css::util::URL m_aFeatureURL; - ::cppu::OInterfaceContainerHelper m_aStatusListeners; + ::comphelper::OInterfaceContainerHelper2 m_aStatusListeners; EditView* m_pEditView; bool m_bDisposed; @@ -49,7 +49,7 @@ namespace frm protected: inline const css::util::URL& getFeatureURL() const { return m_aFeatureURL; } - inline ::cppu::OInterfaceContainerHelper& getStatusListeners() { return m_aStatusListeners; } + inline ::comphelper::OInterfaceContainerHelper2& getStatusListeners() { return m_aStatusListeners; } inline bool isDisposed() const { return m_bDisposed; } inline void checkDisposed() const { if ( isDisposed() ) throw css::lang::DisposedException(); } diff --git a/forms/source/richtext/richtextmodel.hxx b/forms/source/richtext/richtextmodel.hxx index a08a89d3f8d9..f3ed47408040 100644 --- a/forms/source/richtext/richtextmodel.hxx +++ b/forms/source/richtext/richtextmodel.hxx @@ -95,7 +95,7 @@ namespace frm m_pEngine; bool m_bSettingEngineText; - ::cppu::OInterfaceContainerHelper + ::comphelper::OInterfaceContainerHelper2 m_aModifyListeners; public: -- cgit