From 86abf3a682b424dc0fcbccf030f5a0b9bfb81d8c Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Sat, 7 Aug 2021 09:24:46 +0200 Subject: create comphelper::OMultiTypeInterfaceContainerHelper2 and use it based on OInterfaceContainerHelper2 which is considerably faster than the original OInterfaceContainerHelper Change-Id: I9c8b6d0e5382018824bf7188a26343703abf2d51 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120161 Tested-by: Jenkins Reviewed-by: Noel Grandin --- package/source/xstor/owriteablestream.cxx | 7 ++++--- package/source/xstor/xstorage.cxx | 11 ++++++----- 2 files changed, 10 insertions(+), 8 deletions(-) (limited to 'package/source') diff --git a/package/source/xstor/owriteablestream.cxx b/package/source/xstor/owriteablestream.cxx index 1b13d49c79db..89daf8ccafdb 100644 --- a/package/source/xstor/owriteablestream.cxx +++ b/package/source/xstor/owriteablestream.cxx @@ -44,6 +44,7 @@ #include #include #include +#include #include #include @@ -66,7 +67,7 @@ struct WSInternalData_Impl { rtl::Reference m_xSharedMutex; ::std::unique_ptr< ::cppu::OTypeCollection> m_pTypeCollection; - ::cppu::OMultiTypeInterfaceContainerHelper m_aListenersContainer; // list of listeners + comphelper::OMultiTypeInterfaceContainerHelper2 m_aListenersContainer; // list of listeners sal_Int32 m_nStorageType; // the mutex reference MUST NOT be empty @@ -3008,13 +3009,13 @@ void OWriteStream::BroadcastTransaction( sal_Int8 nMessage ) lang::EventObject aSource( static_cast< ::cppu::OWeakObject* >(this) ); - ::cppu::OInterfaceContainerHelper* pContainer = + comphelper::OInterfaceContainerHelper2* pContainer = m_pData->m_aListenersContainer.getContainer( cppu::UnoType::get()); if ( !pContainer ) return; - ::cppu::OInterfaceIteratorHelper pIterator( *pContainer ); + comphelper::OInterfaceIteratorHelper2 pIterator( *pContainer ); while ( pIterator.hasMoreElements( ) ) { OSL_ENSURE( nMessage >= 1 && nMessage <= 4, "Wrong internal notification code is used!" ); diff --git a/package/source/xstor/xstorage.cxx b/package/source/xstor/xstorage.cxx index f7e86b4234ad..470ec4468130 100644 --- a/package/source/xstor/xstorage.cxx +++ b/package/source/xstor/xstorage.cxx @@ -56,6 +56,7 @@ #include #include +#include #include #include "xstorage.hxx" @@ -75,7 +76,7 @@ using namespace ::com::sun::star; struct StorInternalData_Impl { rtl::Reference m_xSharedMutex; - ::cppu::OMultiTypeInterfaceContainerHelper m_aListenersContainer; // list of listeners + comphelper::OMultiTypeInterfaceContainerHelper2 m_aListenersContainer; // list of listeners ::std::unique_ptr< ::cppu::OTypeCollection> m_pTypeCollection; bool m_bIsRoot; sal_Int32 m_nStorageType; // the mode in which the storage is used @@ -1921,12 +1922,12 @@ void OStorage::BroadcastModifiedIfNecessary() lang::EventObject aSource( static_cast< ::cppu::OWeakObject* >(this) ); - ::cppu::OInterfaceContainerHelper* pContainer = + comphelper::OInterfaceContainerHelper2* pContainer = m_pData->m_aListenersContainer.getContainer( cppu::UnoType::get()); if ( pContainer ) { - ::cppu::OInterfaceIteratorHelper pIterator( *pContainer ); + comphelper::OInterfaceIteratorHelper2 pIterator( *pContainer ); while ( pIterator.hasMoreElements( ) ) { static_cast( pIterator.next( ) )->modified( aSource ); @@ -1953,13 +1954,13 @@ void OStorage::BroadcastTransaction( sal_Int8 nMessage ) lang::EventObject aSource( static_cast< ::cppu::OWeakObject* >(this) ); - ::cppu::OInterfaceContainerHelper* pContainer = + comphelper::OInterfaceContainerHelper2* pContainer = m_pData->m_aListenersContainer.getContainer( cppu::UnoType::get()); if ( !pContainer ) return; - ::cppu::OInterfaceIteratorHelper pIterator( *pContainer ); + comphelper::OInterfaceIteratorHelper2 pIterator( *pContainer ); while ( pIterator.hasMoreElements( ) ) { OSL_ENSURE( nMessage >= 1 && nMessage <= 4, "Wrong internal notification code is used!" ); -- cgit