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 --- framework/inc/helper/uiconfigelementwrapperbase.hxx | 3 ++- framework/inc/helper/uielementwrapperbase.hxx | 3 ++- framework/inc/services/layoutmanager.hxx | 4 ++-- framework/inc/uielement/statusbarmanager.hxx | 4 ++-- framework/inc/uielement/toolbarmanager.hxx | 4 ++-- framework/source/fwe/helper/titlehelper.cxx | 4 ++-- framework/source/layoutmanager/layoutmanager.cxx | 6 +++--- framework/source/services/desktop.cxx | 12 ++++++------ framework/source/services/frame.cxx | 14 +++++++------- framework/source/uiconfiguration/imagemanagerimpl.cxx | 4 ++-- framework/source/uiconfiguration/imagemanagerimpl.hxx | 4 ++-- .../uiconfiguration/moduleuiconfigurationmanager.cxx | 7 ++++--- .../source/uiconfiguration/uiconfigurationmanager.cxx | 7 ++++--- 13 files changed, 40 insertions(+), 36 deletions(-) (limited to 'framework') diff --git a/framework/inc/helper/uiconfigelementwrapperbase.hxx b/framework/inc/helper/uiconfigelementwrapperbase.hxx index a58c187c0945..5b561bef5db5 100644 --- a/framework/inc/helper/uiconfigelementwrapperbase.hxx +++ b/framework/inc/helper/uiconfigelementwrapperbase.hxx @@ -30,6 +30,7 @@ #include #include +#include #include #include #include @@ -132,7 +133,7 @@ class UIConfigElementWrapperBase : private cppu::BaseMutex, css::uno::Reference< css::container::XIndexAccess > m_xConfigData; css::uno::WeakReference< css::frame::XFrame > m_xWeakFrame; css::uno::Reference< css::awt::XMenuBar > m_xMenuBar; - ::cppu::OMultiTypeInterfaceContainerHelper m_aListenerContainer; /// container for ALL Listener + comphelper::OMultiTypeInterfaceContainerHelper2 m_aListenerContainer; /// container for ALL Listener }; } // namespace framework diff --git a/framework/inc/helper/uielementwrapperbase.hxx b/framework/inc/helper/uielementwrapperbase.hxx index 71fc8d0784ae..573755f2020d 100644 --- a/framework/inc/helper/uielementwrapperbase.hxx +++ b/framework/inc/helper/uielementwrapperbase.hxx @@ -26,6 +26,7 @@ #include #include +#include #include #include #include @@ -98,7 +99,7 @@ class UIElementWrapperBase : private cppu::BaseMutex, static css::uno::Sequence< css::beans::Property > impl_getStaticPropertyDescriptor(); - ::cppu::OMultiTypeInterfaceContainerHelper m_aListenerContainer; /// container for ALL Listener + comphelper::OMultiTypeInterfaceContainerHelper2 m_aListenerContainer; /// container for ALL Listener OUString m_aResourceURL; css::uno::WeakReference< css::frame::XFrame > m_xWeakFrame; sal_Int16 m_nType; diff --git a/framework/inc/services/layoutmanager.hxx b/framework/inc/services/layoutmanager.hxx index 0274492db1d3..189be410bfc9 100644 --- a/framework/inc/services/layoutmanager.hxx +++ b/framework/inc/services/layoutmanager.hxx @@ -35,7 +35,7 @@ #include #include #include -#include +#include #include #include #include @@ -261,7 +261,7 @@ namespace framework std::unique_ptr m_pGlobalSettings; OUString m_aModuleIdentifier; Timer m_aAsyncLayoutTimer; - ::cppu::OMultiTypeInterfaceContainerHelper m_aListenerContainer; // container for ALL Listener + comphelper::OMultiTypeInterfaceContainerHelper2 m_aListenerContainer; // container for ALL Listener rtl::Reference< ToolbarLayoutManager > m_xToolbarManager; friend class detail::InfoHelperBuilder; diff --git a/framework/inc/uielement/statusbarmanager.hxx b/framework/inc/uielement/statusbarmanager.hxx index c4b2876277ad..99cf94ea1d59 100644 --- a/framework/inc/uielement/statusbarmanager.hxx +++ b/framework/inc/uielement/statusbarmanager.hxx @@ -26,7 +26,7 @@ #include #include -#include +#include #include #include #include @@ -93,7 +93,7 @@ class StatusBarManager final: public ::cppu::WeakImplHelper< css::uno::Reference< css::frame::XFrame > m_xFrame; StatusBarControllerMap m_aControllerMap; osl::Mutex m_mutex; - ::cppu::OMultiTypeInterfaceContainerHelper m_aListenerContainer; /// container for ALL Listener + comphelper::OMultiTypeInterfaceContainerHelper2 m_aListenerContainer; /// container for ALL Listener css::uno::Reference< css::uno::XComponentContext > m_xContext; css::uno::Reference< css::frame::XUIControllerFactory > m_xStatusbarControllerFactory; }; diff --git a/framework/inc/uielement/toolbarmanager.hxx b/framework/inc/uielement/toolbarmanager.hxx index 6de526423d38..a12528415184 100644 --- a/framework/inc/uielement/toolbarmanager.hxx +++ b/framework/inc/uielement/toolbarmanager.hxx @@ -37,7 +37,7 @@ #include #include -#include +#include #include #include @@ -229,7 +229,7 @@ class ToolBarManager final : public ToolbarManager_Base css::uno::Reference< css::frame::XFrame > m_xFrame; ToolBarControllerMap m_aControllerMap; osl::Mutex m_mutex; - ::cppu::OMultiTypeInterfaceContainerHelper m_aListenerContainer; /// container for ALL Listener + comphelper::OMultiTypeInterfaceContainerHelper2 m_aListenerContainer; /// container for ALL Listener css::uno::Reference< css::uno::XComponentContext > m_xContext; css::uno::Reference< css::frame::XUIControllerFactory > m_xToolbarControllerFactory; css::uno::Reference< css::ui::XImageManager > m_xModuleImageManager; diff --git a/framework/source/fwe/helper/titlehelper.cxx b/framework/source/fwe/helper/titlehelper.cxx index ae9c1f348b0e..246032945512 100644 --- a/framework/source/fwe/helper/titlehelper.cxx +++ b/framework/source/fwe/helper/titlehelper.cxx @@ -283,11 +283,11 @@ void TitleHelper::impl_sendTitleChangedEvent () if( ! aEvent.Source.is() ) return; - ::cppu::OInterfaceContainerHelper* pContainer = m_aListener.getContainer( cppu::UnoType::get()); + comphelper::OInterfaceContainerHelper2* pContainer = m_aListener.getContainer( cppu::UnoType::get()); if ( ! pContainer) return; - ::cppu::OInterfaceIteratorHelper pIt( *pContainer ); + comphelper::OInterfaceIteratorHelper2 pIt( *pContainer ); while ( pIt.hasMoreElements() ) { try diff --git a/framework/source/layoutmanager/layoutmanager.cxx b/framework/source/layoutmanager/layoutmanager.cxx index a717de1fa00f..4d821b4e08ae 100644 --- a/framework/source/layoutmanager/layoutmanager.cxx +++ b/framework/source/layoutmanager/layoutmanager.cxx @@ -2580,12 +2580,12 @@ void SAL_CALL LayoutManager::removeLayoutManagerEventListener( const uno::Refere void LayoutManager::implts_notifyListeners(short nEvent, const uno::Any& rInfoParam) { - lang::EventObject aSource( static_cast< ::cppu::OWeakObject*>(this) ); - ::cppu::OInterfaceContainerHelper* pContainer = m_aListenerContainer.getContainer( cppu::UnoType::get()); + comphelper::OInterfaceContainerHelper2* pContainer = m_aListenerContainer.getContainer( cppu::UnoType::get()); if (pContainer==nullptr) return; - ::cppu::OInterfaceIteratorHelper pIterator(*pContainer); + lang::EventObject aSource( static_cast< ::cppu::OWeakObject*>(this) ); + comphelper::OInterfaceIteratorHelper2 pIterator(*pContainer); while (pIterator.hasMoreElements()) { try diff --git a/framework/source/services/desktop.cxx b/framework/source/services/desktop.cxx index 0315ab1bae70..ea2f0cac77f5 100644 --- a/framework/source/services/desktop.cxx +++ b/framework/source/services/desktop.cxx @@ -1554,13 +1554,13 @@ bool Desktop::impl_sendQueryTerminationEvent(Desktop::TTerminateListenerList& lC { TransactionGuard aTransaction( m_aTransactionManager, E_HARDEXCEPTIONS ); - ::cppu::OInterfaceContainerHelper* pContainer = m_aListenerContainer.getContainer( cppu::UnoType::get()); + comphelper::OInterfaceContainerHelper2* pContainer = m_aListenerContainer.getContainer( cppu::UnoType::get()); if ( ! pContainer ) return true; css::lang::EventObject aEvent( static_cast< ::cppu::OWeakObject* >(this) ); - ::cppu::OInterfaceIteratorHelper aIterator( *pContainer ); + comphelper::OInterfaceIteratorHelper2 aIterator( *pContainer ); while ( aIterator.hasMoreElements() ) { try @@ -1612,11 +1612,11 @@ void Desktop::impl_sendTerminateToClipboard() { TransactionGuard aTransaction( m_aTransactionManager, E_HARDEXCEPTIONS ); - ::cppu::OInterfaceContainerHelper* pContainer = m_aListenerContainer.getContainer( cppu::UnoType::get()); + comphelper::OInterfaceContainerHelper2* pContainer = m_aListenerContainer.getContainer( cppu::UnoType::get()); if ( ! pContainer ) return; - ::cppu::OInterfaceIteratorHelper aIterator( *pContainer ); + comphelper::OInterfaceIteratorHelper2 aIterator( *pContainer ); while ( aIterator.hasMoreElements() ) { try @@ -1650,13 +1650,13 @@ void Desktop::impl_sendNotifyTerminationEvent() { TransactionGuard aTransaction( m_aTransactionManager, E_HARDEXCEPTIONS ); - ::cppu::OInterfaceContainerHelper* pContainer = m_aListenerContainer.getContainer( cppu::UnoType::get()); + comphelper::OInterfaceContainerHelper2* pContainer = m_aListenerContainer.getContainer( cppu::UnoType::get()); if ( ! pContainer ) return; css::lang::EventObject aEvent( static_cast< ::cppu::OWeakObject* >(this) ); - ::cppu::OInterfaceIteratorHelper aIterator( *pContainer ); + comphelper::OInterfaceIteratorHelper2 aIterator( *pContainer ); while ( aIterator.hasMoreElements() ) { try diff --git a/framework/source/services/frame.cxx b/framework/source/services/frame.cxx index f74dad8f5fd3..c373c5fa1162 100644 --- a/framework/source/services/frame.cxx +++ b/framework/source/services/frame.cxx @@ -68,7 +68,7 @@ #include #include -#include +#include #include #include #include @@ -377,7 +377,7 @@ private: /// helper for XFrames, XIndexAccess and XElementAccess interfaces css::uno::Reference< css::frame::XFrames > m_xFramesHelper; /// container for ALL Listener - ::cppu::OMultiTypeInterfaceContainerHelper m_aListenerContainer; + comphelper::OMultiTypeInterfaceContainerHelper2 m_aListenerContainer; /// parent of this frame css::uno::Reference< css::frame::XFramesSupplier > m_xParent; /// containerwindow of this frame for embedded components @@ -1671,10 +1671,10 @@ void SAL_CALL XFrameImpl::close( sal_Bool bDeliverOwnership ) // internal operations too... // Note: container is threadsafe himself. css::lang::EventObject aSource (static_cast< ::cppu::OWeakObject*>(this)); - ::cppu::OInterfaceContainerHelper* pContainer = m_aListenerContainer.getContainer( cppu::UnoType::get()); + comphelper::OInterfaceContainerHelper2* pContainer = m_aListenerContainer.getContainer( cppu::UnoType::get()); if (pContainer!=nullptr) { - ::cppu::OInterfaceIteratorHelper pIterator(*pContainer); + comphelper::OInterfaceIteratorHelper2 pIterator(*pContainer); while (pIterator.hasMoreElements()) { try @@ -1708,7 +1708,7 @@ void SAL_CALL XFrameImpl::close( sal_Bool bDeliverOwnership ) pContainer = m_aListenerContainer.getContainer( cppu::UnoType::get()); if (pContainer!=nullptr) { - ::cppu::OInterfaceIteratorHelper pIterator(*pContainer); + comphelper::OInterfaceIteratorHelper2 pIterator(*pContainer); while (pIterator.hasMoreElements()) { try @@ -2947,7 +2947,7 @@ void XFrameImpl::implts_sendFrameActionEvent( const css::frame::FrameAction& aAc // Get container for right listener. // FOLLOW LINES ARE THREADSAFE!!! // ( OInterfaceContainerHelper2 is synchronized with m_aListenerContainer! ) - ::cppu::OInterfaceContainerHelper* pContainer = m_aListenerContainer.getContainer( + comphelper::OInterfaceContainerHelper2* pContainer = m_aListenerContainer.getContainer( cppu::UnoType::get()); if( pContainer == nullptr ) @@ -2957,7 +2957,7 @@ void XFrameImpl::implts_sendFrameActionEvent( const css::frame::FrameAction& aAc css::frame::FrameActionEvent aFrameActionEvent( static_cast< ::cppu::OWeakObject* >(this), this, aAction ); // Get iterator for access to listener. - ::cppu::OInterfaceIteratorHelper aIterator( *pContainer ); + comphelper::OInterfaceIteratorHelper2 aIterator( *pContainer ); // Send message to all listener. while( aIterator.hasMoreElements() ) { diff --git a/framework/source/uiconfiguration/imagemanagerimpl.cxx b/framework/source/uiconfiguration/imagemanagerimpl.cxx index ecd4d18b2391..04ec4db065e1 100644 --- a/framework/source/uiconfiguration/imagemanagerimpl.cxx +++ b/framework/source/uiconfiguration/imagemanagerimpl.cxx @@ -1161,12 +1161,12 @@ void ImageManagerImpl::removeConfigurationListener( const uno::Reference< css::u void ImageManagerImpl::implts_notifyContainerListener( const ConfigurationEvent& aEvent, NotifyOp eOp ) { - ::cppu::OInterfaceContainerHelper* pContainer = m_aListenerContainer.getContainer( + comphelper::OInterfaceContainerHelper2* pContainer = m_aListenerContainer.getContainer( cppu::UnoType::get()); if ( pContainer == nullptr ) return; - ::cppu::OInterfaceIteratorHelper pIterator( *pContainer ); + comphelper::OInterfaceIteratorHelper2 pIterator( *pContainer ); while ( pIterator.hasMoreElements() ) { try diff --git a/framework/source/uiconfiguration/imagemanagerimpl.hxx b/framework/source/uiconfiguration/imagemanagerimpl.hxx index 3621be9fb489..9bc6f4eb7077 100644 --- a/framework/source/uiconfiguration/imagemanagerimpl.hxx +++ b/framework/source/uiconfiguration/imagemanagerimpl.hxx @@ -27,7 +27,7 @@ #include #include -#include +#include #include #include @@ -171,7 +171,7 @@ namespace framework OUString m_aModuleIdentifier; OUString m_aResourceString; osl::Mutex m_mutex; - ::cppu::OMultiTypeInterfaceContainerHelper m_aListenerContainer; /// container for ALL Listener + comphelper::OMultiTypeInterfaceContainerHelper2 m_aListenerContainer; /// container for ALL Listener o3tl::enumarray> m_pUserImageList; o3tl::enumarray m_bUserImageListModified; bool m_bUseGlobal; diff --git a/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx b/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx index 8aeea629694a..02954c18dfd6 100644 --- a/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx +++ b/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx @@ -54,6 +54,7 @@ #include #include #include +#include #include #include #include @@ -211,7 +212,7 @@ private: css::uno::Reference< css::embed::XTransactedObject > m_xUserRootCommit; css::uno::Reference< css::uno::XComponentContext > m_xContext; osl::Mutex m_mutex; - ::cppu::OMultiTypeInterfaceContainerHelper m_aListenerContainer; /// container for ALL Listener + comphelper::OMultiTypeInterfaceContainerHelper2 m_aListenerContainer; /// container for ALL Listener rtl::Reference< ImageManager > m_xModuleImageManager; css::uno::Reference< css::ui::XAcceleratorConfiguration > m_xModuleAcceleratorManager; }; @@ -1610,11 +1611,11 @@ sal_Bool SAL_CALL ModuleUIConfigurationManager::isReadOnly() void ModuleUIConfigurationManager::implts_notifyContainerListener( const ui::ConfigurationEvent& aEvent, NotifyOp eOp ) { - ::cppu::OInterfaceContainerHelper* pContainer = m_aListenerContainer.getContainer( cppu::UnoType::get()); + comphelper::OInterfaceContainerHelper2* pContainer = m_aListenerContainer.getContainer( cppu::UnoType::get()); if ( pContainer == nullptr ) return; - ::cppu::OInterfaceIteratorHelper pIterator( *pContainer ); + comphelper::OInterfaceIteratorHelper2 pIterator( *pContainer ); while ( pIterator.hasMoreElements() ) { try diff --git a/framework/source/uiconfiguration/uiconfigurationmanager.cxx b/framework/source/uiconfiguration/uiconfigurationmanager.cxx index e210eb9d2ab5..038c0585ae53 100644 --- a/framework/source/uiconfiguration/uiconfigurationmanager.cxx +++ b/framework/source/uiconfiguration/uiconfigurationmanager.cxx @@ -48,6 +48,7 @@ #include #include #include +#include #include #include #include @@ -189,7 +190,7 @@ private: OUString m_aPropUIName; css::uno::Reference< css::uno::XComponentContext > m_xContext; osl::Mutex m_mutex; - cppu::OMultiTypeInterfaceContainerHelper m_aListenerContainer; /// container for ALL Listener + comphelper::OMultiTypeInterfaceContainerHelper2 m_aListenerContainer; /// container for ALL Listener rtl::Reference< ImageManager > m_xImageManager; css::uno::Reference< css::ui::XAcceleratorConfiguration > m_xAccConfig; }; @@ -1334,11 +1335,11 @@ sal_Bool SAL_CALL UIConfigurationManager::isReadOnly() void UIConfigurationManager::implts_notifyContainerListener( const ConfigurationEvent& aEvent, NotifyOp eOp ) { - ::cppu::OInterfaceContainerHelper* pContainer = m_aListenerContainer.getContainer( cppu::UnoType::get()); + comphelper::OInterfaceContainerHelper2* pContainer = m_aListenerContainer.getContainer( cppu::UnoType::get()); if ( pContainer == nullptr ) return; - ::cppu::OInterfaceIteratorHelper pIterator( *pContainer ); + comphelper::OInterfaceIteratorHelper2 pIterator( *pContainer ); while ( pIterator.hasMoreElements() ) { try -- cgit