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 /svx | |
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 'svx')
-rw-r--r-- | svx/source/accessibility/AccessibleFrameSelector.cxx | 2 | ||||
-rw-r--r-- | svx/source/fmcomp/fmgridif.cxx | 14 | ||||
-rw-r--r-- | svx/source/fmcomp/gridcell.cxx | 4 | ||||
-rw-r--r-- | svx/source/form/formcontroller.cxx | 12 | ||||
-rw-r--r-- | svx/source/form/formfeaturedispatcher.cxx | 2 | ||||
-rw-r--r-- | svx/source/inc/AccessibleFrameSelector.hxx | 6 | ||||
-rw-r--r-- | svx/source/inc/formcontroller.hxx | 3 | ||||
-rw-r--r-- | svx/source/inc/formfeaturedispatcher.hxx | 4 | ||||
-rw-r--r-- | svx/source/inc/gridcell.hxx | 25 | ||||
-rw-r--r-- | svx/source/unodialogs/textconversiondlgs/chinese_translation_unodialog.hxx | 3 | ||||
-rw-r--r-- | svx/source/unodraw/unoshape.cxx | 2 | ||||
-rw-r--r-- | svx/source/unodraw/unoshcol.cxx | 7 |
12 files changed, 44 insertions, 40 deletions
diff --git a/svx/source/accessibility/AccessibleFrameSelector.cxx b/svx/source/accessibility/AccessibleFrameSelector.cxx index 3a85aa885a4d..6faa1b547396 100644 --- a/svx/source/accessibility/AccessibleFrameSelector.cxx +++ b/svx/source/accessibility/AccessibleFrameSelector.cxx @@ -475,7 +475,7 @@ void AccFrameSelector::NotifyFocusListeners(bool bGetFocus) Reference < XAccessibleContext > xThis( this ); aEvent.Source = xThis; - ::cppu::OInterfaceIteratorHelper aIter( maFocusListeners ); + ::comphelper::OInterfaceIteratorHelper2 aIter( maFocusListeners ); while( aIter.hasMoreElements() ) { Reference < XFocusListener > xListener( aIter.next(), UNO_QUERY ); diff --git a/svx/source/fmcomp/fmgridif.cxx b/svx/source/fmcomp/fmgridif.cxx index c2d34589075b..6e589fe441f6 100644 --- a/svx/source/fmcomp/fmgridif.cxx +++ b/svx/source/fmcomp/fmgridif.cxx @@ -124,7 +124,7 @@ vcl::Font ImplCreateFont( const css::awt::FontDescriptor& rDescr ) FmXModifyMultiplexer::FmXModifyMultiplexer( ::cppu::OWeakObject& rSource, ::osl::Mutex& _rMutex ) :OWeakSubObject( rSource ) - ,OInterfaceContainerHelper( _rMutex ) + ,OInterfaceContainerHelper2( _rMutex ) { } @@ -158,7 +158,7 @@ void FmXModifyMultiplexer::modified(const EventObject& e) throw( RuntimeExceptio FmXUpdateMultiplexer::FmXUpdateMultiplexer( ::cppu::OWeakObject& rSource, ::osl::Mutex& _rMutex ) :OWeakSubObject( rSource ) - ,OInterfaceContainerHelper( _rMutex ) + ,OInterfaceContainerHelper2( _rMutex ) { } @@ -191,7 +191,7 @@ sal_Bool FmXUpdateMultiplexer::approveUpdate(const EventObject &e) throw( Runtim bool bResult = true; if (getLength()) { - ::cppu::OInterfaceIteratorHelper aIter(*this); + ::comphelper::OInterfaceIteratorHelper2 aIter(*this); while ( bResult && aIter.hasMoreElements() ) bResult = static_cast< XUpdateListener* >( aIter.next() )->approveUpdate( aMulti ); } @@ -209,7 +209,7 @@ void FmXUpdateMultiplexer::updated(const EventObject &e) throw( RuntimeException FmXSelectionMultiplexer::FmXSelectionMultiplexer( ::cppu::OWeakObject& rSource, ::osl::Mutex& _rMutex ) :OWeakSubObject( rSource ) - ,OInterfaceContainerHelper( _rMutex ) + ,OInterfaceContainerHelper2( _rMutex ) { } @@ -243,7 +243,7 @@ void SAL_CALL FmXSelectionMultiplexer::selectionChanged( const EventObject& _rEv FmXContainerMultiplexer::FmXContainerMultiplexer( ::cppu::OWeakObject& rSource, ::osl::Mutex& _rMutex ) :OWeakSubObject( rSource ) - ,OInterfaceContainerHelper( _rMutex ) + ,OInterfaceContainerHelper2( _rMutex ) { } @@ -293,7 +293,7 @@ void FmXContainerMultiplexer::elementReplaced(const ContainerEvent& e) throw( Ru FmXGridControlMultiplexer::FmXGridControlMultiplexer( ::cppu::OWeakObject& rSource, ::osl::Mutex& _rMutex ) :OWeakSubObject( rSource ) - ,OInterfaceContainerHelper( _rMutex ) + ,OInterfaceContainerHelper2( _rMutex ) { } @@ -1499,7 +1499,7 @@ sal_Bool FmXGridPeer::commit() throw( RuntimeException, std::exception ) return sal_True; EventObject aEvt(static_cast< ::cppu::OWeakObject* >(this)); - ::cppu::OInterfaceIteratorHelper aIter(m_aUpdateListeners); + ::comphelper::OInterfaceIteratorHelper2 aIter(m_aUpdateListeners); bool bCancel = false; while (aIter.hasMoreElements() && !bCancel) if ( !static_cast< XUpdateListener* >( aIter.next() )->approveUpdate( aEvt ) ) diff --git a/svx/source/fmcomp/gridcell.cxx b/svx/source/fmcomp/gridcell.cxx index ac2b744ad6e1..45ebd249bbd0 100644 --- a/svx/source/fmcomp/gridcell.cxx +++ b/svx/source/fmcomp/gridcell.cxx @@ -4326,7 +4326,7 @@ IMPL_LINK_NOARG_TYPED(FmXListBoxCell, OnDoubleClick, ListBox&, void) { if (m_pBox) { - ::cppu::OInterfaceIteratorHelper aIt( m_aActionListeners ); + ::comphelper::OInterfaceIteratorHelper2 aIt( m_aActionListeners ); css::awt::ActionEvent aEvent; aEvent.Source = *this; @@ -4686,7 +4686,7 @@ void SAL_CALL FmXFilterCell::setMaxTextLen( sal_Int16 /*nLen*/ ) throw( RuntimeE IMPL_LINK_NOARG_TYPED(FmXFilterCell, OnCommit, DbFilterField&, void) { - ::cppu::OInterfaceIteratorHelper aIt( m_aTextListeners ); + ::comphelper::OInterfaceIteratorHelper2 aIt( m_aTextListeners ); css::awt::TextEvent aEvt; aEvt.Source = *this; while( aIt.hasMoreElements() ) diff --git a/svx/source/form/formcontroller.cxx b/svx/source/form/formcontroller.cxx index 3b3fe6edbde3..5d8895abaef4 100644 --- a/svx/source/form/formcontroller.cxx +++ b/svx/source/form/formcontroller.cxx @@ -3660,7 +3660,7 @@ sal_Bool SAL_CALL FormController::approveRowChange(const RowChangeEvent& _rEvent ::osl::ClearableMutexGuard aGuard( m_aMutex ); impl_checkDisposed_throw(); - ::cppu::OInterfaceIteratorHelper aIter(m_aRowSetApproveListeners); + ::comphelper::OInterfaceIteratorHelper2 aIter(m_aRowSetApproveListeners); bool bValid = true; if (aIter.hasMoreElements()) { @@ -3748,7 +3748,7 @@ sal_Bool SAL_CALL FormController::approveCursorMove(const EventObject& event) th ::osl::MutexGuard aGuard( m_aMutex ); impl_checkDisposed_throw(); - ::cppu::OInterfaceIteratorHelper aIter(m_aRowSetApproveListeners); + ::comphelper::OInterfaceIteratorHelper2 aIter(m_aRowSetApproveListeners); if (aIter.hasMoreElements()) { EventObject aEvt(event); @@ -3765,7 +3765,7 @@ sal_Bool SAL_CALL FormController::approveRowSetChange(const EventObject& event) ::osl::MutexGuard aGuard( m_aMutex ); impl_checkDisposed_throw(); - ::cppu::OInterfaceIteratorHelper aIter(m_aRowSetApproveListeners); + ::comphelper::OInterfaceIteratorHelper2 aIter(m_aRowSetApproveListeners); if (aIter.hasMoreElements()) { EventObject aEvt(event); @@ -3802,7 +3802,7 @@ void SAL_CALL FormController::errorOccured(const SQLErrorEvent& aEvent) throw( R ::osl::ClearableMutexGuard aGuard( m_aMutex ); impl_checkDisposed_throw(); - ::cppu::OInterfaceIteratorHelper aIter(m_aErrorListeners); + ::comphelper::OInterfaceIteratorHelper2 aIter(m_aErrorListeners); if (aIter.hasMoreElements()) { SQLErrorEvent aEvt(aEvent); @@ -3875,7 +3875,7 @@ sal_Bool SAL_CALL FormController::approveParameter(const DatabaseParameterEvent& ::osl::MutexGuard aGuard( m_aMutex ); impl_checkDisposed_throw(); - ::cppu::OInterfaceIteratorHelper aIter(m_aParameterListeners); + ::comphelper::OInterfaceIteratorHelper2 aIter(m_aParameterListeners); if (aIter.hasMoreElements()) { DatabaseParameterEvent aEvt(aEvent); @@ -3971,7 +3971,7 @@ sal_Bool SAL_CALL FormController::confirmDelete(const RowChangeEvent& aEvent) th ::osl::MutexGuard aGuard( m_aMutex ); impl_checkDisposed_throw(); - ::cppu::OInterfaceIteratorHelper aIter(m_aDeleteListeners); + ::comphelper::OInterfaceIteratorHelper2 aIter(m_aDeleteListeners); if (aIter.hasMoreElements()) { RowChangeEvent aEvt(aEvent); diff --git a/svx/source/form/formfeaturedispatcher.cxx b/svx/source/form/formfeaturedispatcher.cxx index 3f213db05755..f9016c7d3a8d 100644 --- a/svx/source/form/formfeaturedispatcher.cxx +++ b/svx/source/form/formfeaturedispatcher.cxx @@ -97,7 +97,7 @@ namespace svx } else { - ::cppu::OInterfaceIteratorHelper aIter( m_aStatusListeners ); + ::comphelper::OInterfaceIteratorHelper2 aIter( m_aStatusListeners ); _rFreeForNotification.clear(); while ( aIter.hasMoreElements() ) diff --git a/svx/source/inc/AccessibleFrameSelector.hxx b/svx/source/inc/AccessibleFrameSelector.hxx index aff5046e2510..49439a74f800 100644 --- a/svx/source/inc/AccessibleFrameSelector.hxx +++ b/svx/source/inc/AccessibleFrameSelector.hxx @@ -31,7 +31,7 @@ #include <tools/resary.hxx> #include <tools/rc.hxx> #include <cppuhelper/implbase.hxx> -#include <cppuhelper/interfacecontainer.hxx> +#include <comphelper/interfacecontainer2.hxx> #include <comphelper/accessibleeventnotifier.hxx> #include <svx/framebordertype.hxx> #include <vcl/vclptr.hxx> @@ -116,8 +116,8 @@ private: FrameBorderType meBorder; - ::cppu::OInterfaceContainerHelper maFocusListeners; - ::cppu::OInterfaceContainerHelper maPropertyListeners; + ::comphelper::OInterfaceContainerHelper2 maFocusListeners; + ::comphelper::OInterfaceContainerHelper2 maPropertyListeners; ResStringArray maNames; ResStringArray maDescriptions; diff --git a/svx/source/inc/formcontroller.hxx b/svx/source/inc/formcontroller.hxx index 410a6d858cdc..1e862e9ec2ae 100644 --- a/svx/source/inc/formcontroller.hxx +++ b/svx/source/inc/formcontroller.hxx @@ -74,6 +74,7 @@ #include <comphelper/broadcasthelper.hxx> #include <comphelper/proparrhlp.hxx> #include <cppuhelper/propshlp.hxx> +#include <comphelper/interfacecontainer2.hxx> #include <vcl/timer.hxx> #include <vcl/idle.hxx> @@ -148,7 +149,7 @@ namespace svxform css::uno::Reference< css::form::runtime::XFormControllerContext > m_xFormControllerContext; css::uno::Sequence< css::uno::Reference< css::awt::XControl> > m_aControls; - ::cppu::OInterfaceContainerHelper + ::comphelper::OInterfaceContainerHelper2 m_aActivateListeners, m_aModifyListeners, m_aErrorListeners, diff --git a/svx/source/inc/formfeaturedispatcher.hxx b/svx/source/inc/formfeaturedispatcher.hxx index b6885b934583..58e1e77eb308 100644 --- a/svx/source/inc/formfeaturedispatcher.hxx +++ b/svx/source/inc/formfeaturedispatcher.hxx @@ -25,7 +25,7 @@ #include <com/sun/star/form/runtime/XFormOperations.hpp> #include <cppuhelper/implbase.hxx> -#include <cppuhelper/interfacecontainer.hxx> +#include <comphelper/interfacecontainer2.hxx> namespace svx @@ -38,7 +38,7 @@ namespace svx { private: ::osl::Mutex& m_rMutex; - ::cppu::OInterfaceContainerHelper m_aStatusListeners; + ::comphelper::OInterfaceContainerHelper2 m_aStatusListeners; css::uno::Reference< css::form::runtime::XFormOperations > m_xFormOperations; const css::util::URL m_aFeatureURL; diff --git a/svx/source/inc/gridcell.hxx b/svx/source/inc/gridcell.hxx index 04082d3ca5e6..9394d47a12d8 100644 --- a/svx/source/inc/gridcell.hxx +++ b/svx/source/inc/gridcell.hxx @@ -40,6 +40,7 @@ #include <com/sun/star/awt/XWindow.hpp> #include <comphelper/propmultiplex.hxx> +#include <comphelper/interfacecontainer2.hxx> #include <cppuhelper/component.hxx> #include <cppuhelper/implbase1.hxx> #include <cppuhelper/implbase2.hxx> @@ -717,11 +718,11 @@ protected: DbCellControl* m_pCellControl; private: - ::cppu::OInterfaceContainerHelper m_aWindowListeners; - ::cppu::OInterfaceContainerHelper m_aFocusListeners; - ::cppu::OInterfaceContainerHelper m_aKeyListeners; - ::cppu::OInterfaceContainerHelper m_aMouseListeners; - ::cppu::OInterfaceContainerHelper m_aMouseMotionListeners; + ::comphelper::OInterfaceContainerHelper2 m_aWindowListeners; + ::comphelper::OInterfaceContainerHelper2 m_aFocusListeners; + ::comphelper::OInterfaceContainerHelper2 m_aKeyListeners; + ::comphelper::OInterfaceContainerHelper2 m_aMouseListeners; + ::comphelper::OInterfaceContainerHelper2 m_aMouseMotionListeners; protected: virtual ~FmXGridCell(); @@ -870,8 +871,8 @@ private: OUString m_sValueOnEnter; protected: - ::cppu::OInterfaceContainerHelper m_aTextListeners; - ::cppu::OInterfaceContainerHelper m_aChangeListeners; + ::comphelper::OInterfaceContainerHelper2 m_aTextListeners; + ::comphelper::OInterfaceContainerHelper2 m_aChangeListeners; ::svt::IEditImplementation* m_pEditImplementation; bool m_bOwnEditImplementation; @@ -924,8 +925,8 @@ typedef ::cppu::ImplHelper2 < css::awt::XCheckBox class FmXCheckBoxCell : public FmXDataCell, public FmXCheckBoxCell_Base { - ::cppu::OInterfaceContainerHelper m_aItemListeners; - ::cppu::OInterfaceContainerHelper m_aActionListeners; + ::comphelper::OInterfaceContainerHelper2 m_aItemListeners; + ::comphelper::OInterfaceContainerHelper2 m_aActionListeners; OUString m_aActionCommand; VclPtr<CheckBox> m_pBox; @@ -969,7 +970,7 @@ typedef ::cppu::ImplHelper1 < css::awt::XListBox class FmXListBoxCell :public FmXTextCell ,public FmXListBoxCell_Base { - ::cppu::OInterfaceContainerHelper m_aItemListeners, + ::comphelper::OInterfaceContainerHelper2 m_aItemListeners, m_aActionListeners; VclPtr<ListBox> m_pBox; @@ -1024,7 +1025,7 @@ class FmXComboBoxCell :public FmXTextCell ,public FmXComboBoxCell_Base { private: - ::cppu::OInterfaceContainerHelper m_aItemListeners, + ::comphelper::OInterfaceContainerHelper2 m_aItemListeners, m_aActionListeners; VclPtr<ComboBox> m_pComboBox; @@ -1067,7 +1068,7 @@ typedef ::cppu::ImplHelper2 < css::awt::XTextComponent class FmXFilterCell :public FmXGridCell ,public FmXFilterCell_Base { - ::cppu::OInterfaceContainerHelper m_aTextListeners; + ::comphelper::OInterfaceContainerHelper2 m_aTextListeners; protected: virtual ~FmXFilterCell(); public: diff --git a/svx/source/unodialogs/textconversiondlgs/chinese_translation_unodialog.hxx b/svx/source/unodialogs/textconversiondlgs/chinese_translation_unodialog.hxx index 9f64e1a655fd..a55b0e52b545 100644 --- a/svx/source/unodialogs/textconversiondlgs/chinese_translation_unodialog.hxx +++ b/svx/source/unodialogs/textconversiondlgs/chinese_translation_unodialog.hxx @@ -29,6 +29,7 @@ #include <com/sun/star/ui/dialogs/XExecutableDialog.hpp> #include <com/sun/star/uno/XComponentContext.hpp> #include <cppuhelper/implbase.hxx> +#include <comphelper/interfacecontainer2.hxx> #include <vcl/vclptr.hxx> @@ -119,7 +120,7 @@ private: bool m_bDisposed; ///Dispose call ready. bool m_bInDispose;///In dispose call osl::Mutex m_aContainerMutex; - cppu::OInterfaceContainerHelper m_aDisposeEventListeners; + comphelper::OInterfaceContainerHelper2 m_aDisposeEventListeners; }; diff --git a/svx/source/unodraw/unoshape.cxx b/svx/source/unodraw/unoshape.cxx index 7653b263f4c9..3bbdff48a8e8 100644 --- a/svx/source/unodraw/unoshape.cxx +++ b/svx/source/unodraw/unoshape.cxx @@ -123,7 +123,7 @@ struct SvxShapeImpl ::tools::WeakReference< SdrObject > mpCreatedObj; // for xComponent - ::cppu::OInterfaceContainerHelper maDisposeListeners; + ::comphelper::OInterfaceContainerHelper2 maDisposeListeners; svx::PropertyChangeNotifier maPropertyNotifier; SvxShapeImpl( SvxShape& _rAntiImpl, ::osl::Mutex& _rMutex ) diff --git a/svx/source/unodraw/unoshcol.cxx b/svx/source/unodraw/unoshcol.cxx index e28b50288056..5057ba801c9e 100644 --- a/svx/source/unodraw/unoshcol.cxx +++ b/svx/source/unodraw/unoshcol.cxx @@ -25,6 +25,7 @@ #include <cppuhelper/implbase3.hxx> #include <cppuhelper/interfacecontainer.hxx> +#include <comphelper/interfacecontainer2.hxx> #include <cppuhelper/supportsservice.hxx> #include <osl/mutex.hxx> #include <rtl/ref.hxx> @@ -46,7 +47,7 @@ class SvxShapeCollection : public SvxShapeCollectionMutex { private: - cppu::OInterfaceContainerHelper maShapeContainer; + comphelper::OInterfaceContainerHelper2 maShapeContainer; cppu::OBroadcastHelper mrBHelper; @@ -229,10 +230,10 @@ uno::Any SAL_CALL SvxShapeCollection::getByIndex( sal_Int32 Index ) if( Index < 0 || Index >= getCount() ) throw lang::IndexOutOfBoundsException(); - uno::Sequence< Reference< uno::XInterface> > xElements( maShapeContainer.getElements() ); + std::vector< Reference< uno::XInterface> > xElements( maShapeContainer.getElements() ); - return uno::makeAny( Reference< drawing::XShape>(static_cast< drawing::XShape* >( xElements.getArray()[Index].get())) ); + return uno::makeAny( Reference< drawing::XShape>(static_cast< drawing::XShape* >( xElements[Index].get())) ); } // XElementAccess |