diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2021-08-07 09:24:46 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-08-07 21:34:33 +0200 |
commit | 86abf3a682b424dc0fcbccf030f5a0b9bfb81d8c (patch) | |
tree | ba40de884231f604bbd8eedb610834d92afb86ae /framework | |
parent | 2cd1442f83d41af1f2b663ccb8bfab6a954009f1 (diff) |
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 <noel.grandin@collabora.co.uk>
Diffstat (limited to 'framework')
-rw-r--r-- | framework/inc/helper/uiconfigelementwrapperbase.hxx | 3 | ||||
-rw-r--r-- | framework/inc/helper/uielementwrapperbase.hxx | 3 | ||||
-rw-r--r-- | framework/inc/services/layoutmanager.hxx | 4 | ||||
-rw-r--r-- | framework/inc/uielement/statusbarmanager.hxx | 4 | ||||
-rw-r--r-- | framework/inc/uielement/toolbarmanager.hxx | 4 | ||||
-rw-r--r-- | framework/source/fwe/helper/titlehelper.cxx | 4 | ||||
-rw-r--r-- | framework/source/layoutmanager/layoutmanager.cxx | 6 | ||||
-rw-r--r-- | framework/source/services/desktop.cxx | 12 | ||||
-rw-r--r-- | framework/source/services/frame.cxx | 14 | ||||
-rw-r--r-- | framework/source/uiconfiguration/imagemanagerimpl.cxx | 4 | ||||
-rw-r--r-- | framework/source/uiconfiguration/imagemanagerimpl.hxx | 4 | ||||
-rw-r--r-- | framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx | 7 | ||||
-rw-r--r-- | framework/source/uiconfiguration/uiconfigurationmanager.cxx | 7 |
13 files changed, 40 insertions, 36 deletions
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 <com/sun/star/lang/XComponent.hpp> #include <rtl/ustring.hxx> +#include <comphelper/multicontainer2.hxx> #include <cppuhelper/basemutex.hxx> #include <cppuhelper/propshlp.hxx> #include <cppuhelper/implbase.hxx> @@ -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 <com/sun/star/util/XUpdatable.hpp> #include <rtl/ustring.hxx> +#include <comphelper/multicontainer2.hxx> #include <cppuhelper/basemutex.hxx> #include <cppuhelper/propshlp.hxx> #include <cppuhelper/implbase.hxx> @@ -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 <cppuhelper/basemutex.hxx> #include <cppuhelper/propshlp.hxx> #include <cppuhelper/implbase.hxx> -#include <cppuhelper/interfacecontainer.hxx> +#include <comphelper/multicontainer2.hxx> #include <cppuhelper/supportsservice.hxx> #include <comphelper/propertycontainer.hxx> #include <comphelper/uno3.hxx> @@ -261,7 +261,7 @@ namespace framework std::unique_ptr<GlobalSettings> 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 <com/sun/star/uno/XComponentContext.hpp> #include <cppuhelper/implbase.hxx> -#include <cppuhelper/interfacecontainer.hxx> +#include <comphelper/multicontainer2.hxx> #include <vcl/status.hxx> #include <vcl/vclptr.hxx> #include <map> @@ -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 <rtl/ustring.hxx> #include <cppuhelper/implbase.hxx> -#include <cppuhelper/interfacecontainer.hxx> +#include <comphelper/multicontainer2.hxx> #include <tools/link.hxx> #include <vcl/weld.hxx> @@ -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<css::frame::XTitleChangeListener>::get()); + comphelper::OInterfaceContainerHelper2* pContainer = m_aListener.getContainer( cppu::UnoType<css::frame::XTitleChangeListener>::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<frame::XLayoutManagerListener>::get()); + comphelper::OInterfaceContainerHelper2* pContainer = m_aListenerContainer.getContainer( cppu::UnoType<frame::XLayoutManagerListener>::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<css::frame::XTerminateListener>::get()); + comphelper::OInterfaceContainerHelper2* pContainer = m_aListenerContainer.getContainer( cppu::UnoType<css::frame::XTerminateListener>::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<css::frame::XTerminateListener>::get()); + comphelper::OInterfaceContainerHelper2* pContainer = m_aListenerContainer.getContainer( cppu::UnoType<css::frame::XTerminateListener>::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<css::frame::XTerminateListener>::get()); + comphelper::OInterfaceContainerHelper2* pContainer = m_aListenerContainer.getContainer( cppu::UnoType<css::frame::XTerminateListener>::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 <cppuhelper/basemutex.hxx> #include <cppuhelper/compbase.hxx> -#include <cppuhelper/interfacecontainer.hxx> +#include <comphelper/multicontainer2.hxx> #include <cppuhelper/supportsservice.hxx> #include <cppuhelper/weak.hxx> #include <sal/log.hxx> @@ -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<css::util::XCloseListener>::get()); + comphelper::OInterfaceContainerHelper2* pContainer = m_aListenerContainer.getContainer( cppu::UnoType<css::util::XCloseListener>::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<css::util::XCloseListener>::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<css::frame::XFrameActionListener>::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<css::ui::XUIConfigurationListener>::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 <com/sun/star/embed/XTransactedObject.hpp> #include <cppuhelper/weak.hxx> -#include <cppuhelper/interfacecontainer.hxx> +#include <comphelper/multicontainer2.hxx> #include <rtl/ustring.hxx> #include <rtl/ref.hxx> @@ -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<vcl::ImageType,std::unique_ptr<ImageList>> m_pUserImageList; o3tl::enumarray<vcl::ImageType,bool> 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 <cppuhelper/supportsservice.hxx> #include <vcl/svapp.hxx> #include <sal/log.hxx> +#include <comphelper/multicontainer2.hxx> #include <comphelper/sequenceashashmap.hxx> #include <comphelper/servicehelper.hxx> #include <memory> @@ -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<css::ui::XUIConfigurationListener>::get()); + comphelper::OInterfaceContainerHelper2* pContainer = m_aListenerContainer.getContainer( cppu::UnoType<css::ui::XUIConfigurationListener>::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 <cppuhelper/implbase.hxx> #include <cppuhelper/supportsservice.hxx> #include <comphelper/propertysequence.hxx> +#include <comphelper/multicontainer2.hxx> #include <comphelper/sequence.hxx> #include <comphelper/servicehelper.hxx> #include <vcl/svapp.hxx> @@ -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<css::ui::XUIConfigurationListener>::get()); + comphelper::OInterfaceContainerHelper2* pContainer = m_aListenerContainer.getContainer( cppu::UnoType<css::ui::XUIConfigurationListener>::get()); if ( pContainer == nullptr ) return; - ::cppu::OInterfaceIteratorHelper pIterator( *pContainer ); + comphelper::OInterfaceIteratorHelper2 pIterator( *pContainer ); while ( pIterator.hasMoreElements() ) { try |