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 /sfx2 | |
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 'sfx2')
-rw-r--r-- | sfx2/source/doc/printhelper.cxx | 8 | ||||
-rw-r--r-- | sfx2/source/doc/sfxbasemodel.cxx | 22 | ||||
-rw-r--r-- | sfx2/source/view/sfxbasecontroller.cxx | 7 |
3 files changed, 19 insertions, 18 deletions
diff --git a/sfx2/source/doc/printhelper.cxx b/sfx2/source/doc/printhelper.cxx index 6ed21500a2a9..cb4fd94571be 100644 --- a/sfx2/source/doc/printhelper.cxx +++ b/sfx2/source/doc/printhelper.cxx @@ -39,7 +39,7 @@ #include <tools/urlobj.hxx> #include <tools/diagnose_ex.h> #include <ucbhelper/content.hxx> -#include <cppuhelper/interfacecontainer.hxx> +#include <comphelper/multicontainer2.hxx> #include <osl/mutex.hxx> #include <cppuhelper/implbase.hxx> #include <vcl/settings.hxx> @@ -59,7 +59,7 @@ using namespace ::com::sun::star::uno; struct IMPL_PrintListener_DataContainer : public SfxListener { SfxObjectShellRef m_pObjectShell; - ::cppu::OMultiTypeInterfaceContainerHelper m_aInterfaceContainer; + comphelper::OMultiTypeInterfaceContainerHelper2 m_aInterfaceContainer; uno::Reference< css::view::XPrintJob> m_xPrintJob; css::uno::Sequence< css::beans::PropertyValue > m_aPrintOptions; @@ -778,7 +778,7 @@ void IMPL_PrintListener_DataContainer::Notify( SfxBroadcaster& rBC, const SfxHin m_aPrintOptions = pPrintHint->GetOptions(); } - ::cppu::OInterfaceContainerHelper* pContainer = m_aInterfaceContainer.getContainer( + comphelper::OInterfaceContainerHelper2* pContainer = m_aInterfaceContainer.getContainer( cppu::UnoType<view::XPrintJobListener>::get()); if ( !pContainer ) return; @@ -787,7 +787,7 @@ void IMPL_PrintListener_DataContainer::Notify( SfxBroadcaster& rBC, const SfxHin aEvent.Source = m_xPrintJob; aEvent.State = pPrintHint->GetWhich(); - ::cppu::OInterfaceIteratorHelper pIterator(*pContainer); + comphelper::OInterfaceIteratorHelper2 pIterator(*pContainer); while (pIterator.hasMoreElements()) static_cast<view::XPrintJobListener*>(pIterator.next())->printJobEvent( aEvent ); } diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx index c95c068463cd..50835238c40b 100644 --- a/sfx2/source/doc/sfxbasemodel.cxx +++ b/sfx2/source/doc/sfxbasemodel.cxx @@ -59,7 +59,7 @@ #include <comphelper/enumhelper.hxx> #include <cppuhelper/implbase.hxx> -#include <cppuhelper/interfacecontainer.hxx> +#include <comphelper/multicontainer2.hxx> #include <cppuhelper/exc_hlp.hxx> #include <comphelper/processfactory.hxx> #include <comphelper/sequenceashashmap.hxx> @@ -188,7 +188,7 @@ struct IMPL_SfxBaseModel_DataContainer : public ::sfx2::IModifiableDocument OUString m_sURL ; OUString m_sRuntimeUID ; OUString m_aPreusedFilterName ; - ::cppu::OMultiTypeInterfaceContainerHelper m_aInterfaceContainer ; + comphelper::OMultiTypeInterfaceContainerHelper2 m_aInterfaceContainer ; std::unordered_map<css::uno::Reference< css::drawing::XShape >, std::vector<css::uno::Reference< css::document::XShapeEventListener >>> maShapeListeners; Reference< XInterface > m_xParent ; @@ -331,10 +331,10 @@ void SAL_CALL SfxPrintHelperListener_Impl::disposing( const lang::EventObject& ) void SAL_CALL SfxPrintHelperListener_Impl::printJobEvent( const view::PrintJobEvent& rEvent ) { - ::cppu::OInterfaceContainerHelper* pContainer = m_pData->m_aInterfaceContainer.getContainer( cppu::UnoType<view::XPrintJobListener>::get()); + ::comphelper::OInterfaceContainerHelper2* pContainer = m_pData->m_aInterfaceContainer.getContainer( cppu::UnoType<view::XPrintJobListener>::get()); if ( pContainer!=nullptr ) { - ::cppu::OInterfaceIteratorHelper pIterator(*pContainer); + ::comphelper::OInterfaceIteratorHelper2 pIterator(*pContainer); while (pIterator.hasMoreElements()) static_cast<view::XPrintJobListener*>(pIterator.next())->printJobEvent( rEvent ); } @@ -1427,10 +1427,10 @@ void SAL_CALL SfxBaseModel::close( sal_Bool bDeliverOwnership ) Reference< XInterface > xSelfHold( static_cast< ::cppu::OWeakObject* >(this) ); lang::EventObject aSource ( static_cast< ::cppu::OWeakObject* >(this) ); - ::cppu::OInterfaceContainerHelper* pContainer = m_pData->m_aInterfaceContainer.getContainer( cppu::UnoType<util::XCloseListener>::get()); + comphelper::OInterfaceContainerHelper2* pContainer = m_pData->m_aInterfaceContainer.getContainer( cppu::UnoType<util::XCloseListener>::get()); if (pContainer!=nullptr) { - ::cppu::OInterfaceIteratorHelper pIterator(*pContainer); + comphelper::OInterfaceIteratorHelper2 pIterator(*pContainer); while (pIterator.hasMoreElements()) { try @@ -1458,7 +1458,7 @@ void SAL_CALL SfxBaseModel::close( sal_Bool bDeliverOwnership ) pContainer = m_pData->m_aInterfaceContainer.getContainer( cppu::UnoType<util::XCloseListener>::get()); if (pContainer!=nullptr) { - ::cppu::OInterfaceIteratorHelper pCloseIterator(*pContainer); + comphelper::OInterfaceIteratorHelper2 pCloseIterator(*pContainer); while (pCloseIterator.hasMoreElements()) { try @@ -2900,7 +2900,7 @@ void SfxBaseModel::Notify( SfxBroadcaster& rBC , void SfxBaseModel::NotifyModifyListeners_Impl() const { - ::cppu::OInterfaceContainerHelper* pIC = m_pData->m_aInterfaceContainer.getContainer( cppu::UnoType<util::XModifyListener>::get()); + comphelper::OInterfaceContainerHelper2* pIC = m_pData->m_aInterfaceContainer.getContainer( cppu::UnoType<util::XModifyListener>::get()); if ( pIC ) { lang::EventObject aEvent( static_cast<frame::XModel *>(const_cast<SfxBaseModel *>(this)) ); @@ -3223,7 +3223,7 @@ void SfxBaseModel::postEvent_Impl( const OUString& aName, const Reference< frame if (aName.isEmpty()) return; - ::cppu::OInterfaceContainerHelper* pIC = + comphelper::OInterfaceContainerHelper2* pIC = m_pData->m_aInterfaceContainer.getContainer( cppu::UnoType<document::XDocumentEventListener>::get()); if ( pIC ) { @@ -3304,13 +3304,13 @@ void SfxBaseModel::notifyEvent( const document::EventObject& aEvent ) const if ( impl_isDisposed() ) return; - ::cppu::OInterfaceContainerHelper* pIC = m_pData->m_aInterfaceContainer.getContainer( + comphelper::OInterfaceContainerHelper2* pIC = m_pData->m_aInterfaceContainer.getContainer( cppu::UnoType<document::XEventListener>::get()); if( !pIC ) return; - ::cppu::OInterfaceIteratorHelper aIt( *pIC ); + comphelper::OInterfaceIteratorHelper2 aIt( *pIC ); while( aIt.hasMoreElements() ) { try diff --git a/sfx2/source/view/sfxbasecontroller.cxx b/sfx2/source/view/sfxbasecontroller.cxx index 8f5bfddba32d..60252a3b71cb 100644 --- a/sfx2/source/view/sfxbasecontroller.cxx +++ b/sfx2/source/view/sfxbasecontroller.cxx @@ -41,6 +41,7 @@ #include <com/sun/star/lang/XComponent.hpp> #include <com/sun/star/container/XIndexAccess.hpp> #include <comphelper/interfacecontainer2.hxx> +#include <comphelper/multicontainer2.hxx> #include <sfx2/viewsh.hxx> #include <sfx2/docfac.hxx> #include <sfx2/viewfrm.hxx> @@ -353,7 +354,7 @@ struct IMPL_SfxBaseController_DataContainer Reference< XFrameActionListener > m_xListener ; Reference< XCloseListener > m_xCloseListener ; ::sfx2::UserInputInterception m_aUserInputInterception; - ::cppu::OMultiTypeInterfaceContainerHelper m_aListenerContainer ; + ::comphelper::OMultiTypeInterfaceContainerHelper2 m_aListenerContainer ; ::comphelper::OInterfaceContainerHelper2 m_aInterceptorContainer ; Reference< XStatusIndicator > m_xIndicator ; SfxViewShell* m_pViewShell ; @@ -890,7 +891,7 @@ awt::Rectangle SAL_CALL SfxBaseController::queryBorderedArea( const awt::Rectang void SfxBaseController::BorderWidthsChanged_Impl() { - ::cppu::OInterfaceContainerHelper* pContainer = m_pData->m_aListenerContainer.getContainer( + ::comphelper::OInterfaceContainerHelper2* pContainer = m_pData->m_aListenerContainer.getContainer( cppu::UnoType<frame::XBorderResizeListener>::get()); if ( !pContainer ) return; @@ -898,7 +899,7 @@ void SfxBaseController::BorderWidthsChanged_Impl() frame::BorderWidths aBWidths = getBorder(); Reference< uno::XInterface > xThis( static_cast< ::cppu::OWeakObject* >(this), uno::UNO_QUERY ); - ::cppu::OInterfaceIteratorHelper pIterator(*pContainer); + ::comphelper::OInterfaceIteratorHelper2 pIterator(*pContainer); while (pIterator.hasMoreElements()) { try |