comphelper/source/property/genericpropertyset.cxx |    6 
 dbaccess/source/core/dataaccess/ContentHelper.cxx |    8 
 dbaccess/source/core/inc/ContentHelper.hxx        |    4 
 dbaccess/source/ui/browser/formadapter.cxx        |    2 
 dbaccess/source/ui/browser/sbagrid.cxx            |    8 
 dbaccess/source/ui/inc/sbagrid.hxx                |    3 
 dbaccess/source/ui/inc/sbamultiplex.hxx           |   18 -
 embeddedobj/source/general/intercept.cxx          |    6 
 embedserv/source/embed/intercept.cxx              |   16 -
 framework/inc/stdtypes.h                          |    4 
 framework/source/services/autorecovery.cxx        |    4 
 framework/source/services/frame.cxx               |    8 
 include/comphelper/multiinterfacecontainer2.hxx   |  245 ++++++++++++++++++++++
 include/svx/shapepropertynotifier.hxx             |    4 
 linguistic/source/lngopt.cxx                      |    4 
 linguistic/source/lngopt.hxx                      |    4 
 sfx2/inc/unoctitm.hxx                             |    3 
 sfx2/source/control/unoctitm.cxx                  |    6 
 svx/source/unodraw/shapepropertynotifier.cxx      |    4 
 sw/source/uibase/inc/unomailmerge.hxx             |    3 
 sw/source/uibase/uno/unomailmerge.cxx             |    4 
 ucb/source/cacher/contentresultsetwrapper.cxx     |   26 +-
 ucb/source/cacher/contentresultsetwrapper.hxx     |    3 
 ucb/source/core/ucbstore.cxx                      |    8 
 ucb/source/core/ucbstore.hxx                      |    3 
 ucb/source/sorter/sortresult.cxx                  |    9 
 ucb/source/ucp/file/bc.cxx                        |    9 
 ucb/source/ucp/file/filnot.cxx                    |    2 
 ucb/source/ucp/file/filnot.hxx                    |    2 
 29 files changed, 338 insertions(+), 88 deletions(-)

New commits:
commit 9104017e1bf76857d2b9686363013e1e7c49e355
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Sat Aug 7 18:17:03 2021 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Sun Aug 8 17:04:03 2021 +0200

    create comphelper:OMultiTypeInterfaceContainerHelperVar2 and use it
    
    based on OInterfaceContainerHelper2 which is considerably
    faster than the original OInterfaceContainerHelper
    
    Change-Id: Ia8cdbc5ef877a7af3d9193e1bb2faf1595c15470
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120165
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/comphelper/source/property/genericpropertyset.cxx 
b/comphelper/source/property/genericpropertyset.cxx
index 4bf9d31dc5f0..68ae7a3353b4 100644
--- a/comphelper/source/property/genericpropertyset.cxx
+++ b/comphelper/source/property/genericpropertyset.cxx
@@ -24,8 +24,8 @@
 #include <com/sun/star/lang/XServiceInfo.hpp>
 #include <com/sun/star/lang/XTypeProvider.hpp>
 #include <cppuhelper/weakagg.hxx>
-#include <cppuhelper/interfacecontainer.hxx>
 #include <cppuhelper/supportsservice.hxx>
+#include <comphelper/multiinterfacecontainer2.hxx>
 #include <comphelper/propertysethelper.hxx>
 #include <osl/mutex.hxx>
 #include <rtl/ref.hxx>
@@ -57,7 +57,7 @@ namespace comphelper
     {
     private:
         std::map<OUString, Any>   maAnyMap;
-        cppu::OMultiTypeInterfaceContainerHelperVar<OUString> m_aListener;
+        comphelper::OMultiTypeInterfaceContainerHelperVar2<OUString> 
m_aListener;
 
     protected:
         virtual void _setPropertyValues( const PropertyMapEntry** ppEntries, 
const  Any* pValues ) override;
@@ -148,7 +148,7 @@ void GenericPropertySet::_setPropertyValues( const 
PropertyMapEntry** ppEntries,
 
     while( *ppEntries )
     {
-        OInterfaceContainerHelper * pHelper = 
m_aListener.getContainer((*ppEntries)->maName);
+        OInterfaceContainerHelper2 * pHelper = 
m_aListener.getContainer((*ppEntries)->maName);
 
         maAnyMap[ (*ppEntries)->maName ] = *pValues;
 
diff --git a/dbaccess/source/core/dataaccess/ContentHelper.cxx 
b/dbaccess/source/core/dataaccess/ContentHelper.cxx
index 7de159b2d095..e08fc61b65bb 100644
--- a/dbaccess/source/core/dataaccess/ContentHelper.cxx
+++ b/dbaccess/source/core/dataaccess/ContentHelper.cxx
@@ -486,10 +486,10 @@ void OContentHelper::notifyPropertiesChange( const 
Sequence< PropertyChangeEvent
         return;
 
     // First, notify listeners interested in changes of every property.
-    OInterfaceContainerHelper* pAllPropsContainer = 
m_aPropertyChangeListeners.getContainer( OUString() );
+    comphelper::OInterfaceContainerHelper2* pAllPropsContainer = 
m_aPropertyChangeListeners.getContainer( OUString() );
     if ( pAllPropsContainer )
     {
-        OInterfaceIteratorHelper aIter( *pAllPropsContainer );
+        comphelper::OInterfaceIteratorHelper2 aIter( *pAllPropsContainer );
         while ( aIter.hasMoreElements() )
         {
             // Propagate event.
@@ -507,10 +507,10 @@ void OContentHelper::notifyPropertiesChange( const 
Sequence< PropertyChangeEvent
         const PropertyChangeEvent& rEvent = *propertyChangeEvent;
         const OUString& rName = rEvent.PropertyName;
 
-        OInterfaceContainerHelper* pPropsContainer = 
m_aPropertyChangeListeners.getContainer( rName );
+        comphelper::OInterfaceContainerHelper2* pPropsContainer = 
m_aPropertyChangeListeners.getContainer( rName );
         if ( pPropsContainer )
         {
-            OInterfaceIteratorHelper aIter( *pPropsContainer );
+            comphelper::OInterfaceIteratorHelper2 aIter( *pPropsContainer );
             while ( aIter.hasMoreElements() )
             {
                 Sequence< PropertyChangeEvent >* propertyEvents;
diff --git a/dbaccess/source/core/inc/ContentHelper.hxx 
b/dbaccess/source/core/inc/ContentHelper.hxx
index b7d275481ec1..f23dd4ca2b2d 100644
--- a/dbaccess/source/core/inc/ContentHelper.hxx
+++ b/dbaccess/source/core/inc/ContentHelper.hxx
@@ -29,7 +29,7 @@
 #include <com/sun/star/uno/XComponentContext.hpp>
 #include <cppuhelper/compbase.hxx>
 #include <cppuhelper/basemutex.hxx>
-#include <comphelper/interfacecontainer2.hxx>
+#include <comphelper/multiinterfacecontainer2.hxx>
 #include <com/sun/star/beans/Property.hpp>
 #include <com/sun/star/container/XChild.hpp>
 #include <com/sun/star/sdbcx/XRename.hpp>
@@ -71,7 +71,7 @@ namespace dbaccess
 
     typedef std::shared_ptr<OContentHelper_Impl> TContentPtr;
 
-    typedef cppu::OMultiTypeInterfaceContainerHelperVar<OUString>
+    typedef comphelper::OMultiTypeInterfaceContainerHelperVar2<OUString>
         PropertyChangeListenerContainer;
     typedef ::cppu::WeakComponentImplHelper<   css::ucb::XContent
                                            ,   css::ucb::XCommandProcessor
diff --git a/dbaccess/source/ui/browser/formadapter.cxx 
b/dbaccess/source/ui/browser/formadapter.cxx
index ee38f63609b0..7a07f0a9d206 100644
--- a/dbaccess/source/ui/browser/formadapter.cxx
+++ b/dbaccess/source/ui/browser/formadapter.cxx
@@ -1134,7 +1134,7 @@ void SAL_CALL 
SbaXFormAdapter::setFastPropertyValue(sal_Int32 nHandle, const Any
 
         aValue >>= m_sName;
 
-        ::cppu::OInterfaceIteratorHelper 
aIt(*m_aPropertyChangeListeners.getContainer(PROPERTY_NAME));
+        ::comphelper::OInterfaceIteratorHelper2 
aIt(*m_aPropertyChangeListeners.getContainer(PROPERTY_NAME));
         while (aIt.hasMoreElements())
             static_cast< 
css::beans::XPropertyChangeListener*>(aIt.next())->propertyChange(aEvt);
 
diff --git a/dbaccess/source/ui/browser/sbagrid.cxx 
b/dbaccess/source/ui/browser/sbagrid.cxx
index b65ba2b45d73..5a1f2f9767ea 100644
--- a/dbaccess/source/ui/browser/sbagrid.cxx
+++ b/dbaccess/source/ui/browser/sbagrid.cxx
@@ -279,11 +279,11 @@ void SbaXGridPeer::NotifyStatusChanged(const 
css::util::URL& _rUrl, const Refere
         xControl->statusChanged(aEvt);
     else
     {
-        ::cppu::OInterfaceContainerHelper * pIter = 
m_aStatusListeners.getContainer(_rUrl);
+        ::comphelper::OInterfaceContainerHelper2 * pIter = 
m_aStatusListeners.getContainer(_rUrl);
 
         if (pIter)
         {
-            ::cppu::OInterfaceIteratorHelper aListIter(*pIter);
+            ::comphelper::OInterfaceIteratorHelper2 aListIter(*pIter);
             while (aListIter.hasMoreElements())
                 static_cast< 
css::frame::XStatusListener*>(aListIter.next())->statusChanged(aEvt);
         }
@@ -444,7 +444,7 @@ void SAL_CALL SbaXGridPeer::dispatch(const URL& aURL, const 
Sequence< PropertyVa
 
 void SAL_CALL SbaXGridPeer::addStatusListener(const Reference< 
css::frame::XStatusListener > & xControl, const css::util::URL& aURL)
 {
-    ::cppu::OInterfaceContainerHelper* pCont = 
m_aStatusListeners.getContainer(aURL);
+    ::comphelper::OInterfaceContainerHelper2* pCont = 
m_aStatusListeners.getContainer(aURL);
     if (!pCont)
         m_aStatusListeners.addInterface(aURL,xControl);
     else
@@ -454,7 +454,7 @@ void SAL_CALL SbaXGridPeer::addStatusListener(const 
Reference< css::frame::XStat
 
 void SAL_CALL SbaXGridPeer::removeStatusListener(const Reference< 
css::frame::XStatusListener > & xControl, const css::util::URL& aURL)
 {
-    ::cppu::OInterfaceContainerHelper* pCont = 
m_aStatusListeners.getContainer(aURL);
+    ::comphelper::OInterfaceContainerHelper2* pCont = 
m_aStatusListeners.getContainer(aURL);
     if ( pCont )
         pCont->removeInterface(xControl);
 }
diff --git a/dbaccess/source/ui/inc/sbagrid.hxx 
b/dbaccess/source/ui/inc/sbagrid.hxx
index 841925734c5e..fceb8d84f7ad 100644
--- a/dbaccess/source/ui/inc/sbagrid.hxx
+++ b/dbaccess/source/ui/inc/sbagrid.hxx
@@ -25,6 +25,7 @@
 
 #include <com/sun/star/frame/XDispatch.hpp>
 #include <com/sun/star/util/URL.hpp>
+#include <comphelper/multiinterfacecontainer2.hxx>
 #include <comphelper/servicehelper.hxx>
 #include <comphelper/uno3.hxx>
 #include "sbamultiplex.hxx"
@@ -92,7 +93,7 @@ namespace dbaui
                 :public FmXGridPeer
                 ,public css::frame::XDispatch
     {
-        cppu::OMultiTypeInterfaceContainerHelperVar<
+        comphelper::OMultiTypeInterfaceContainerHelperVar2<
             css::util::URL, void, SbaURLCompare>  m_aStatusListeners;
 
     public:
diff --git a/dbaccess/source/ui/inc/sbamultiplex.hxx 
b/dbaccess/source/ui/inc/sbamultiplex.hxx
index a61aa79e9793..a83d5543b61d 100644
--- a/dbaccess/source/ui/inc/sbamultiplex.hxx
+++ b/dbaccess/source/ui/inc/sbamultiplex.hxx
@@ -32,7 +32,7 @@
 #include <com/sun/star/frame/XStatusListener.hpp>
 #include <comphelper/uno3.hxx>
 #include <cppuhelper/interfacecontainer.hxx>
-#include <comphelper/interfacecontainer2.hxx>
+#include <comphelper/multiinterfacecontainer2.hxx>
 #include <cppuhelper/queryinterface.hxx>
 #include <cppuhelper/weak.hxx>
 
@@ -176,7 +176,7 @@ namespace dbaui
             :public OSbaWeakSubObject                                          
                 \
             ,public listenerclass                                              
             \
     {                                                                          
             \
-        typedef ::cppu::OMultiTypeInterfaceContainerHelperVar<                 
             \
+        typedef ::comphelper::OMultiTypeInterfaceContainerHelperVar2<          
                    \
                 OUString >  ListenerContainerMap;   \
         ListenerContainerMap    m_aListeners;                                  
             \
                                                                                
             \
@@ -198,11 +198,11 @@ namespace dbaui
                                                                                
             \
         sal_Int32 getOverallLen() const;                                       
             \
                                                                                
             \
-        ::cppu::OInterfaceContainerHelper* getContainer(const OUString& rName) 
      \
+        ::comphelper::OInterfaceContainerHelper2* getContainer(const OUString& 
rName)       \
             { return m_aListeners.getContainer(rName); }                       
             \
                                                                                
             \
     private:                                                                   
             \
-        void Notify(::cppu::OInterfaceContainerHelper& rListeners, const 
eventtype& e);     \
+        void Notify(::comphelper::OInterfaceContainerHelper2& rListeners, 
const eventtype& e);     \
     };                                                                         
             \
 
     // implementation of property listener multiplexers
@@ -232,7 +232,7 @@ namespace dbaui
                                                                                
             \
     void SAL_CALL classname::methodname(const eventtype& e)                \
     {                                                                          
             \
-        ::cppu::OInterfaceContainerHelper* pListeners = 
m_aListeners.getContainer(e.PropertyName);  \
+        ::comphelper::OInterfaceContainerHelper2* pListeners = 
m_aListeners.getContainer(e.PropertyName);  \
         if (pListeners)                                                        
             \
             Notify(*pListeners, e);                                            
             \
                                                                                
             \
@@ -263,10 +263,10 @@ namespace dbaui
     sal_Int32 classname::getOverallLen() const                                 
             \
     {                                                                          
             \
         sal_Int32 nLen = 0;                                                    
             \
-        const css::uno::Sequence< OUString > aContained = 
m_aListeners.getContainedTypes(); \
+        const std::vector< OUString > aContained = 
m_aListeners.getContainedTypes(); \
         for ( OUString const & s : aContained)                 \
         {                                                                      
             \
-            ::cppu::OInterfaceContainerHelper* pListeners = 
m_aListeners.getContainer(s);  \
+            ::comphelper::OInterfaceContainerHelper2* pListeners = 
m_aListeners.getContainer(s);  \
             if (!pListeners)                                                   
             \
                 continue;                                                      
             \
             nLen += pListeners->getLength();                                   
             \
@@ -274,11 +274,11 @@ namespace dbaui
         return nLen;                                                           
             \
     }                                                                          
             \
                                                                                
             \
-    void classname::Notify(::cppu::OInterfaceContainerHelper& rListeners, 
const eventtype& e)   \
+    void classname::Notify(::comphelper::OInterfaceContainerHelper2& 
rListeners, const eventtype& e)   \
     {                                                                          
             \
         eventtype aMulti(e);                                                   
             \
         aMulti.Source = &m_rParent;                                            
             \
-        ::cppu::OInterfaceIteratorHelper aIt(rListeners);                      
             \
+        ::comphelper::OInterfaceIteratorHelper2 aIt(rListeners);               
                    \
         while (aIt.hasMoreElements())                                          
             \
             static_cast< listenerclass*>(aIt.next())->methodname(aMulti);      
         \
     }                                                                          
             \
diff --git a/embeddedobj/source/general/intercept.cxx 
b/embeddedobj/source/general/intercept.cxx
index 9b1449cd9518..6e5f9099735c 100644
--- a/embeddedobj/source/general/intercept.cxx
+++ b/embeddedobj/source/general/intercept.cxx
@@ -18,7 +18,7 @@
  */
 
 #include <com/sun/star/embed/EmbedStates.hpp>
-#include <cppuhelper/interfacecontainer.hxx>
+#include <comphelper/multiinterfacecontainer2.hxx>
 
 #include <intercept.hxx>
 #include <docholder.hxx>
@@ -31,11 +31,11 @@ using namespace ::com::sun::star;
 uno::Sequence< OUString > Interceptor::m_aInterceptedURL(IUL);
 
 class StatusChangeListenerContainer
-    : public cppu::OMultiTypeInterfaceContainerHelperVar<OUString>
+    : public comphelper::OMultiTypeInterfaceContainerHelperVar2<OUString>
 {
 public:
     explicit StatusChangeListenerContainer(osl::Mutex& aMutex)
-        :  cppu::OMultiTypeInterfaceContainerHelperVar<OUString>(aMutex)
+        :  comphelper::OMultiTypeInterfaceContainerHelperVar2<OUString>(aMutex)
     {
     }
 };
diff --git a/embedserv/source/embed/intercept.cxx 
b/embedserv/source/embed/intercept.cxx
index ebe94913744b..2caeec236536 100644
--- a/embedserv/source/embed/intercept.cxx
+++ b/embedserv/source/embed/intercept.cxx
@@ -17,7 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 #include <cppuhelper/weak.hxx>
-#include <cppuhelper/interfacecontainer.hxx>
+#include <comphelper/multiinterfacecontainer2.hxx>
 
 #include <embeddoc.hxx>
 #include <docholder.hxx>
@@ -32,11 +32,11 @@ using namespace ::com::sun::star;
 uno::Sequence< OUString > Interceptor::m_aInterceptedURL(IUL);
 
 class StatusChangeListenerContainer
-    : public cppu::OMultiTypeInterfaceContainerHelperVar<OUString>
+    : public comphelper::OMultiTypeInterfaceContainerHelperVar2<OUString>
 {
 public:
     explicit StatusChangeListenerContainer(osl::Mutex& aMutex)
-        :  cppu::OMultiTypeInterfaceContainerHelperVar<OUString>(aMutex)
+        :  comphelper::OMultiTypeInterfaceContainerHelperVar2<OUString>(aMutex)
     {
     }
 };
@@ -210,12 +210,12 @@ void Interceptor::generateFeatureStateEvent()
             if( i == 1 || (m_bLink && i != 5) )
                 continue;
 
-            cppu::OInterfaceContainerHelper* pICH =
+            comphelper::OInterfaceContainerHelper2* pICH =
                 m_pStatCL->getContainer(m_aInterceptedURL[i]);
-            uno::Sequence<uno::Reference<uno::XInterface> > aSeq;
-            if(pICH)
-                aSeq = pICH->getElements();
-            if(!aSeq.getLength())
+            if(!pICH)
+                continue;
+            std::vector<uno::Reference<uno::XInterface> > aSeq = 
pICH->getElements();
+            if(aSeq.empty())
                 continue;
 
             frame::FeatureStateEvent aStateEvent;
diff --git a/framework/inc/stdtypes.h b/framework/inc/stdtypes.h
index a61ccc8fdc33..feec3ef92ceb 100644
--- a/framework/inc/stdtypes.h
+++ b/framework/inc/stdtypes.h
@@ -21,7 +21,7 @@
 
 #include <com/sun/star/awt/KeyEvent.hpp>
 
-#include <cppuhelper/interfacecontainer.hxx>
+#include <comphelper/multiinterfacecontainer2.hxx>
 #include <rtl/ustring.hxx>
 
 namespace framework{
@@ -61,7 +61,7 @@ struct KeyEventEqualsFunc
     Mapping between these two parts of a property should be done in the 
fastest way :-)
 */
 
-typedef cppu::OMultiTypeInterfaceContainerHelperVar<OUString> ListenerHash;
+typedef comphelper::OMultiTypeInterfaceContainerHelperVar2<OUString> 
ListenerHash;
 
 }       // namespace framework
 
diff --git a/framework/source/services/autorecovery.cxx 
b/framework/source/services/autorecovery.cxx
index 0c79cd4c97e9..43869f7bdc44 100644
--- a/framework/source/services/autorecovery.cxx
+++ b/framework/source/services/autorecovery.cxx
@@ -3489,7 +3489,7 @@ void AutoRecovery::implts_informListener(      Job        
              eJob  ,
                                          const css::frame::FeatureStateEvent& 
aEvent)
 {
     // Helper shares mutex with us -> threadsafe!
-    ::cppu::OInterfaceContainerHelper* pListenerForURL = nullptr;
+    ::comphelper::OInterfaceContainerHelper2* pListenerForURL = nullptr;
     OUString                           sJob            = 
AutoRecovery::implst_getJobDescription(eJob);
 
     // inform listener, which are registered for any URLs(!)
@@ -3497,7 +3497,7 @@ void AutoRecovery::implts_informListener(      Job        
              eJob  ,
     if(pListenerForURL == nullptr)
         return;
 
-    ::cppu::OInterfaceIteratorHelper pIt(*pListenerForURL);
+    ::comphelper::OInterfaceIteratorHelper2 pIt(*pListenerForURL);
     while(pIt.hasMoreElements())
     {
         try
diff --git a/framework/source/services/frame.cxx 
b/framework/source/services/frame.cxx
index c373c5fa1162..9c3aeb2897ef 100644
--- a/framework/source/services/frame.cxx
+++ b/framework/source/services/frame.cxx
@@ -2870,11 +2870,11 @@ bool XFrameImpl::impl_existsVeto(const 
css::beans::PropertyChangeEvent& aEvent)
         The used helper is threadsafe and it lives for the whole lifetime of
         our own object.
     */
-    ::cppu::OInterfaceContainerHelper* pVetoListener = 
m_lVetoChangeListener.getContainer(aEvent.PropertyName);
+    ::comphelper::OInterfaceContainerHelper2* pVetoListener = 
m_lVetoChangeListener.getContainer(aEvent.PropertyName);
     if (! pVetoListener)
         return false;
 
-    ::cppu::OInterfaceIteratorHelper pListener(*pVetoListener);
+    ::comphelper::OInterfaceIteratorHelper2 pListener(*pVetoListener);
     while (pListener.hasMoreElements())
     {
         try
@@ -2899,11 +2899,11 @@ void XFrameImpl::impl_notifyChangeListener(const 
css::beans::PropertyChangeEvent
         The used helper is threadsafe and it lives for the whole lifetime of
         our own object.
     */
-    ::cppu::OInterfaceContainerHelper* pSimpleListener = 
m_lSimpleChangeListener.getContainer(aEvent.PropertyName);
+    ::comphelper::OInterfaceContainerHelper2* pSimpleListener = 
m_lSimpleChangeListener.getContainer(aEvent.PropertyName);
     if (! pSimpleListener)
         return;
 
-    ::cppu::OInterfaceIteratorHelper pListener(*pSimpleListener);
+    ::comphelper::OInterfaceIteratorHelper2 pListener(*pSimpleListener);
     while (pListener.hasMoreElements())
     {
         try
diff --git a/include/comphelper/multiinterfacecontainer2.hxx 
b/include/comphelper/multiinterfacecontainer2.hxx
new file mode 100644
index 000000000000..59d18483baac
--- /dev/null
+++ b/include/comphelper/multiinterfacecontainer2.hxx
@@ -0,0 +1,245 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ *   Licensed to the Apache Software Foundation (ASF) under one or more
+ *   contributor license agreements. See the NOTICE file distributed
+ *   with this work for additional information regarding copyright
+ *   ownership. The ASF licenses this file to you under the Apache
+ *   License, Version 2.0 (the "License"); you may not use this file
+ *   except in compliance with the License. You may obtain a copy of
+ *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#pragma once
+
+#include <sal/config.h>
+
+#include <com/sun/star/lang/EventObject.hpp>
+#include <com/sun/star/lang/DisposedException.hpp>
+#include <comphelper/comphelperdllapi.h>
+#include <comphelper/interfacecontainer2.hxx>
+#include <memory>
+#include <vector>
+
+namespace com::sun::star::uno
+{
+class XInterface;
+}
+namespace osl
+{
+class Mutex;
+}
+
+/** */ //for docpp
+namespace comphelper
+{
+/**
+  A helper class to store interface references of different types.
+  This is a copy of the similiar class at 
include/cppuhelper/interfacecontainer.h,
+  but now uses the improved comphelper::InterfaceContainer2.
+
+  @see OInterfaceIteratorHelper2
+  @see OInterfaceContainerHelper2
+ */
+template <class key, class hashImpl = void, class equalImpl = 
std::equal_to<key>>
+class OMultiTypeInterfaceContainerHelperVar2
+{
+public:
+    /**
+      Create a container of interface containers.
+
+      @param rMutex the mutex to protect multi thread access.
+                         The lifetime must be longer than the lifetime
+                         of this object.
+     */
+    inline OMultiTypeInterfaceContainerHelperVar2(::osl::Mutex& rMutex_)
+        : rMutex(rMutex_)
+    {
+    }
+
+    /**
+      Return all id's under which at least one interface is added.
+     */
+    inline std::vector<key> getContainedTypes() const
+    {
+        ::osl::MutexGuard aGuard(rMutex);
+        std::vector<key> aInterfaceTypes;
+        aInterfaceTypes.reserve(m_aMap.size());
+        for (const auto& rPair : m_aMap)
+            // are interfaces added to this container?
+            if (rPair.second->getLength())
+                // yes, put the type in the array
+                aInterfaceTypes.push_back(rPair.first);
+        return aInterfaceTypes;
+    }
+
+    inline bool hasContainedTypes() const
+    {
+        ::osl::MutexGuard aGuard(rMutex);
+        for (const auto& rPair : m_aMap)
+            // are interfaces added to this container?
+            if (rPair.second->getLength())
+                return true;
+        return false;
+    }
+
+    /**
+      Return the container created under this key.
+      The InterfaceContainerHelper exists until the whole MultiTypeContainer 
is destroyed.
+      @return the container created under this key. If the container
+                 was not created, null was returned.
+     */
+    inline OInterfaceContainerHelper2* getContainer(const key& rKey) const
+    {
+        ::osl::MutexGuard aGuard(rMutex);
+
+        auto iter = find(rKey);
+        if (iter != m_aMap.end())
+            return (*iter).second.get();
+        return nullptr;
+    }
+
+    /** Inserts an element into the container with the specified key.
+        The position is not specified, thus it is not specified in which order 
events are fired.
+
+        @attention
+        If you add the same interface more than once, then it will be added to 
the elements list
+        more than once and thus if you want to remove that interface from the 
list, you have to call
+        removeInterface() the same number of times.
+        In the latter case, you will also get events fired more than once (if 
the interface is a
+        listener interface).
+
+        @param rKey
+               the id of the container
+        @param r
+               interface to be added; it is allowed, to insert null or
+               the same interface more than once
+        @return
+                the new count of elements in the container
+    */
+    inline sal_Int32 addInterface(const key& rKey,
+                                  const 
css::uno::Reference<css::uno::XInterface>& rListener)
+    {
+        ::osl::MutexGuard aGuard(rMutex);
+        auto iter = find(rKey);
+        if (iter == m_aMap.end())
+        {
+            OInterfaceContainerHelper2* pLC = new 
OInterfaceContainerHelper2(rMutex);
+            m_aMap.emplace_back(rKey, pLC);
+            return pLC->addInterface(rListener);
+        }
+        else
+            return (*iter).second->addInterface(rListener);
+    }
+
+    /** Removes an element from the container with the specified key.
+        It uses interface equality to remove the interface.
+
+        @param rKey
+               the id of the container
+        @param rxIFace
+               interface to be removed
+        @return
+                the new count of elements in the container
+    */
+    inline sal_Int32 removeInterface(const key& rKey,
+                                     const 
css::uno::Reference<css::uno::XInterface>& rListener)
+    {
+        ::osl::MutexGuard aGuard(rMutex);
+
+        // search container with id nUik
+        auto iter = find(rKey);
+        // container found?
+        if (iter != m_aMap.end())
+            return (*iter).second->removeInterface(rListener);
+
+        // no container with this id. Always return 0
+        return 0;
+    }
+
+    /**
+      Call disposing on all references in the container, that
+      support XEventListener. Then clears the container.
+      @param rEvt the event object which is passed during disposing() call
+     */
+    inline void disposeAndClear(const css::lang::EventObject& rEvt)
+    {
+        typename InterfaceMap::size_type nSize = 0;
+        OInterfaceContainerHelper2** ppListenerContainers = nullptr;
+        {
+            ::osl::MutexGuard aGuard(rMutex);
+            nSize = m_aMap.size();
+            if (nSize)
+            {
+                typedef OInterfaceContainerHelper2* ppp;
+                ppListenerContainers = new ppp[nSize];
+
+                typename InterfaceMap::iterator iter = m_aMap.begin();
+                typename InterfaceMap::iterator end = m_aMap.end();
+
+                typename InterfaceMap::size_type i = 0;
+                while (iter != end)
+                {
+                    ppListenerContainers[i++] = (*iter).second.get();
+                    ++iter;
+                }
+            }
+        }
+
+        // create a copy, because do not fire event in a guarded section
+        for (typename InterfaceMap::size_type i = 0; i < nSize; i++)
+        {
+            if (ppListenerContainers[i])
+                ppListenerContainers[i]->disposeAndClear(rEvt);
+        }
+
+        delete[] ppListenerContainers;
+    }
+
+    /**
+      Remove all elements of all containers. Does not delete the container.
+     */
+    inline void clear()
+    {
+        ::osl::MutexGuard aGuard(rMutex);
+
+        for (const auto& rPair : m_aMap)
+            rPair.second->clear();
+    }
+
+    typedef key keyType;
+
+private:
+    typedef ::std::vector<std::pair<key, 
std::unique_ptr<OInterfaceContainerHelper2>>> InterfaceMap;
+    InterfaceMap m_aMap;
+    ::osl::Mutex& rMutex;
+
+    typename InterfaceMap::const_iterator find(const key& rKey) const
+    {
+        auto iter = m_aMap.begin();
+        auto end = m_aMap.end();
+
+        while (iter != end)
+        {
+            equalImpl equal;
+            if (equal(iter->first, rKey))
+                break;
+            ++iter;
+        }
+        return iter;
+    }
+
+    OMultiTypeInterfaceContainerHelperVar2(const 
OMultiTypeInterfaceContainerHelperVar2&) = delete;
+    OMultiTypeInterfaceContainerHelperVar2& operator=(const 
OMultiTypeInterfaceContainerHelperVar2&)
+        = delete;
+};
+
+} // namespace comphelper
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/shapepropertynotifier.hxx 
b/include/svx/shapepropertynotifier.hxx
index c0716b6db3da..8e994e15d21d 100644
--- a/include/svx/shapepropertynotifier.hxx
+++ b/include/svx/shapepropertynotifier.hxx
@@ -22,7 +22,7 @@
 
 #include <svx/svxdllapi.h>
 #include <svx/shapeproperty.hxx>
-#include <cppuhelper/interfacecontainer.hxx>
+#include <comphelper/multiinterfacecontainer2.hxx>
 #include <rtl/ustring.hxx>
 
 #include <memory>
@@ -141,7 +141,7 @@ namespace svx
             PropertyProviders;
         ::cppu::OWeakObject&            m_rContext;
         PropertyProviders               m_aProviders;
-        cppu::OMultiTypeInterfaceContainerHelperVar<OUString> 
m_aPropertyChangeListeners;
+        comphelper::OMultiTypeInterfaceContainerHelperVar2<OUString> 
m_aPropertyChangeListeners;
     };
 
 
diff --git a/linguistic/source/lngopt.cxx b/linguistic/source/lngopt.cxx
index 304675fd413c..8ddbac6ca9e2 100644
--- a/linguistic/source/lngopt.cxx
+++ b/linguistic/source/lngopt.cxx
@@ -192,11 +192,11 @@ LinguProps::LinguProps() :
 
 void LinguProps::launchEvent( const PropertyChangeEvent &rEvt ) const
 {
-    cppu::OInterfaceContainerHelper *pContainer =
+    comphelper::OInterfaceContainerHelper2 *pContainer =
             aPropListeners.getContainer( rEvt.PropertyHandle );
     if (pContainer)
     {
-        cppu::OInterfaceIteratorHelper aIt( *pContainer );
+        comphelper::OInterfaceIteratorHelper2 aIt( *pContainer );
         while (aIt.hasMoreElements())
         {
             static_cast< XPropertyChangeListener* >( aIt.next() 
)->propertyChange( rEvt );
diff --git a/linguistic/source/lngopt.hxx b/linguistic/source/lngopt.hxx
index bdb173c22da0..bd2e2fe72dcd 100644
--- a/linguistic/source/lngopt.hxx
+++ b/linguistic/source/lngopt.hxx
@@ -22,7 +22,7 @@
 
 #include <cppuhelper/implbase.hxx>
 #include <cppuhelper/interfacecontainer.hxx>
-#include <comphelper/interfacecontainer2.hxx>
+#include <comphelper/multiinterfacecontainer2.hxx>
 #include <com/sun/star/beans/XFastPropertySet.hpp>
 #include <com/sun/star/beans/XPropertyAccess.hpp>
 #include <com/sun/star/lang/XServiceInfo.hpp>
@@ -59,7 +59,7 @@ public:
             GetActiveDics() const   { return pData->aActiveDics; }
 };
 
-typedef cppu::OMultiTypeInterfaceContainerHelperVar<sal_Int32>
+typedef comphelper::OMultiTypeInterfaceContainerHelperVar2<sal_Int32>
     OPropertyListenerContainerHelper;
 
 class LinguProps :
diff --git a/sfx2/inc/unoctitm.hxx b/sfx2/inc/unoctitm.hxx
index 9e6bc19da488..d68b707e369f 100644
--- a/sfx2/inc/unoctitm.hxx
+++ b/sfx2/inc/unoctitm.hxx
@@ -21,6 +21,7 @@
 #include <memory>
 #include <com/sun/star/frame/XNotifyingDispatch.hpp>
 #include <com/sun/star/lang/XUnoTunnel.hpp>
+#include <comphelper/multiinterfacecontainer2.hxx>
 #include <cppuhelper/implbase.hxx>
 #include <cppuhelper/interfacecontainer.hxx>
 #include <cppuhelper/weakref.hxx>
@@ -38,7 +39,7 @@ class SfxBindings;
 class SfxDispatcher;
 class SfxSlot;
 
-typedef cppu::OMultiTypeInterfaceContainerHelperVar<OUString>
+typedef comphelper::OMultiTypeInterfaceContainerHelperVar2<OUString>
     SfxStatusDispatcher_Impl_ListenerContainer;
 
 class SfxStatusDispatcher   :   public 
cppu::WeakImplHelper<css::frame::XNotifyingDispatch>
diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx
index 1eb2726f212a..235812a239ea 100644
--- a/sfx2/source/control/unoctitm.cxx
+++ b/sfx2/source/control/unoctitm.cxx
@@ -775,10 +775,10 @@ void SfxDispatchController_Impl::addStatusListener(const 
css::uno::Reference< cs
 
 void SfxDispatchController_Impl::sendStatusChanged(const OUString& rURL, const 
css::frame::FeatureStateEvent& rEvent)
 {
-    ::cppu::OInterfaceContainerHelper* pContnr = 
pDispatch->GetListeners().getContainer(rURL);
+    ::comphelper::OInterfaceContainerHelper2* pContnr = 
pDispatch->GetListeners().getContainer(rURL);
     if (!pContnr)
         return;
-    ::cppu::OInterfaceIteratorHelper aIt(*pContnr);
+    ::comphelper::OInterfaceIteratorHelper2 aIt(*pContnr);
     while (aIt.hasMoreElements())
     {
         try
@@ -870,7 +870,7 @@ void SfxDispatchController_Impl::StateChanged( sal_uInt16 
nSID, SfxItemState eSt
         InterceptLOKStateChangeEvent(nSID, pDispatcher->GetFrame(), aEvent, 
pState);
     }
 
-    const css::uno::Sequence<OUString> aContainedTypes = 
pDispatch->GetListeners().getContainedTypes();
+    const std::vector<OUString> aContainedTypes = 
pDispatch->GetListeners().getContainedTypes();
     for (const OUString& rName: aContainedTypes)
     {
         if (rName == aDispatchURL.Main || rName == aDispatchURL.Complete)
diff --git a/svx/source/unodraw/shapepropertynotifier.cxx 
b/svx/source/unodraw/shapepropertynotifier.cxx
index 2d054a6006e4..29ad15f2358f 100644
--- a/svx/source/unodraw/shapepropertynotifier.cxx
+++ b/svx/source/unodraw/shapepropertynotifier.cxx
@@ -95,8 +95,8 @@ namespace svx
 
         OUString sPropertyName( provPos->second->getPropertyName() );
 
-        ::cppu::OInterfaceContainerHelper* pPropListeners = 
m_aPropertyChangeListeners.getContainer( sPropertyName );
-        ::cppu::OInterfaceContainerHelper* pAllListeners = 
m_aPropertyChangeListeners.getContainer( OUString() );
+        ::comphelper::OInterfaceContainerHelper2* pPropListeners = 
m_aPropertyChangeListeners.getContainer( sPropertyName );
+        ::comphelper::OInterfaceContainerHelper2* pAllListeners = 
m_aPropertyChangeListeners.getContainer( OUString() );
         if ( !pPropListeners && !pAllListeners )
             return;
 
diff --git a/sw/source/uibase/inc/unomailmerge.hxx 
b/sw/source/uibase/inc/unomailmerge.hxx
index 325c992e43fd..c94d385adb05 100644
--- a/sw/source/uibase/inc/unomailmerge.hxx
+++ b/sw/source/uibase/inc/unomailmerge.hxx
@@ -23,6 +23,7 @@
 #include <cppuhelper/implbase.hxx>
 #include <cppuhelper/interfacecontainer.hxx>
 #include <comphelper/interfacecontainer2.hxx>
+#include <comphelper/multiinterfacecontainer2.hxx>
 
 #include <com/sun/star/task/XJob.hpp>
 #include <com/sun/star/beans/XPropertySet.hpp>
@@ -56,7 +57,7 @@ namespace com::sun::star {
 
 }
 
-typedef cppu::OMultiTypeInterfaceContainerHelperVar<sal_Int32>
+typedef comphelper::OMultiTypeInterfaceContainerHelperVar2<sal_Int32>
     OPropertyListenerContainerHelper;
 
 class SwDBManager;
diff --git a/sw/source/uibase/uno/unomailmerge.cxx 
b/sw/source/uibase/uno/unomailmerge.cxx
index b3b674f72422..3d8d25f2c74b 100644
--- a/sw/source/uibase/uno/unomailmerge.cxx
+++ b/sw/source/uibase/uno/unomailmerge.cxx
@@ -839,11 +839,11 @@ void SwXMailMerge::LaunchMailMergeEvent( const 
MailMergeEvent &rEvt ) const
 
 void SwXMailMerge::launchEvent( const PropertyChangeEvent &rEvt ) const
 {
-    cppu::OInterfaceContainerHelper *pContainer =
+    comphelper::OInterfaceContainerHelper2 *pContainer =
             m_aPropListeners.getContainer( rEvt.PropertyHandle );
     if (pContainer)
     {
-        cppu::OInterfaceIteratorHelper aIt( *pContainer );
+        comphelper::OInterfaceIteratorHelper2 aIt( *pContainer );
         while (aIt.hasMoreElements())
         {
             static_cast< XPropertyChangeListener* >( aIt.next() 
)->propertyChange( rEvt );
diff --git a/ucb/source/cacher/contentresultsetwrapper.cxx 
b/ucb/source/cacher/contentresultsetwrapper.cxx
index c680cbc68080..0b1175e324f0 100644
--- a/ucb/source/cacher/contentresultsetwrapper.cxx
+++ b/ucb/source/cacher/contentresultsetwrapper.cxx
@@ -181,11 +181,11 @@ void 
ContentResultSetWrapper::impl_notifyPropertyChangeListeners( const Property
     }
 
     // Notify listeners interested especially in the changed property.
-    OInterfaceContainerHelper* pContainer =
+    OInterfaceContainerHelper2* pContainer =
             m_pPropertyChangeListeners->getContainer( rEvt.PropertyName );
     if( pContainer )
     {
-        OInterfaceIteratorHelper aIter( *pContainer );
+        OInterfaceIteratorHelper2 aIter( *pContainer );
         while( aIter.hasMoreElements() )
         {
             static_cast< XPropertyChangeListener* >( aIter.next() 
)->propertyChange( rEvt );
@@ -196,7 +196,7 @@ void 
ContentResultSetWrapper::impl_notifyPropertyChangeListeners( const Property
     pContainer = m_pPropertyChangeListeners->getContainer( OUString() );
     if( pContainer )
     {
-        OInterfaceIteratorHelper aIter( *pContainer );
+        OInterfaceIteratorHelper2 aIter( *pContainer );
         while( aIter.hasMoreElements() )
         {
             static_cast< XPropertyChangeListener* >( aIter.next() 
)->propertyChange( rEvt );
@@ -213,11 +213,11 @@ void 
ContentResultSetWrapper::impl_notifyVetoableChangeListeners( const Property
     }
 
     // Notify listeners interested especially in the changed property.
-    OInterfaceContainerHelper* pContainer =
+    OInterfaceContainerHelper2* pContainer =
             m_pVetoableChangeListeners->getContainer( rEvt.PropertyName );
     if( pContainer )
     {
-        OInterfaceIteratorHelper aIter( *pContainer );
+        OInterfaceIteratorHelper2 aIter( *pContainer );
         while( aIter.hasMoreElements() )
         {
             static_cast< XVetoableChangeListener* >( aIter.next() 
)->vetoableChange( rEvt );
@@ -228,7 +228,7 @@ void 
ContentResultSetWrapper::impl_notifyVetoableChangeListeners( const Property
     pContainer = m_pVetoableChangeListeners->getContainer( OUString() );
     if( pContainer )
     {
-        OInterfaceIteratorHelper aIter( *pContainer );
+        OInterfaceIteratorHelper2 aIter( *pContainer );
         while( aIter.hasMoreElements() )
         {
             static_cast< XVetoableChangeListener* >( aIter.next() 
)->vetoableChange( rEvt );
@@ -524,8 +524,7 @@ void SAL_CALL 
ContentResultSetWrapper::addPropertyChangeListener( const OUString
     }
 
     impl_getPropertyChangeListenerContainer();
-    bool bNeedRegister = !m_pPropertyChangeListeners->
-                        getContainedTypes().hasElements();
+    bool bNeedRegister = !m_pPropertyChangeListeners->hasContainedTypes();
     m_pPropertyChangeListeners->addInterface( aPropertyName, xListener );
     if( !bNeedRegister )
         return;
@@ -569,8 +568,7 @@ void SAL_CALL 
ContentResultSetWrapper::addVetoableChangeListener( const OUString
     }
 
     impl_getVetoableChangeListenerContainer();
-    bool bNeedRegister = !m_pVetoableChangeListeners->
-                        getContainedTypes().hasElements();
+    bool bNeedRegister = !m_pVetoableChangeListeners->hasContainedTypes();
     m_pVetoableChangeListeners->addInterface( rPropertyName, xListener );
     if( !bNeedRegister )
         return;
@@ -608,7 +606,7 @@ void SAL_CALL 
ContentResultSetWrapper::removePropertyChangeListener( const OUStr
         if( !m_pPropertyChangeListeners )
             return;
     }
-    OInterfaceContainerHelper* pContainer =
+    OInterfaceContainerHelper2* pContainer =
         m_pPropertyChangeListeners->getContainer( rPropertyName );
 
     if( !pContainer )
@@ -626,7 +624,7 @@ void SAL_CALL 
ContentResultSetWrapper::removePropertyChangeListener( const OUStr
 
     m_pPropertyChangeListeners->removeInterface( rPropertyName, xListener );
 
-    if( m_pPropertyChangeListeners->getContainedTypes().hasElements() )
+    if( m_pPropertyChangeListeners->hasContainedTypes() )
         return;
 
     impl_init_xPropertySetOrigin();
@@ -661,7 +659,7 @@ void SAL_CALL 
ContentResultSetWrapper::removeVetoableChangeListener( const OUStr
         if( !m_pVetoableChangeListeners )
             return;
     }
-    OInterfaceContainerHelper* pContainer =
+    OInterfaceContainerHelper2* pContainer =
         m_pVetoableChangeListeners->getContainer( rPropertyName );
 
     if( !pContainer )
@@ -679,7 +677,7 @@ void SAL_CALL 
ContentResultSetWrapper::removeVetoableChangeListener( const OUStr
 
     m_pVetoableChangeListeners->removeInterface( rPropertyName, xListener );
 
-    if( m_pVetoableChangeListeners->getContainedTypes().hasElements() )
+    if( m_pVetoableChangeListeners->hasContainedTypes() )
         return;
 
     impl_init_xPropertySetOrigin();
diff --git a/ucb/source/cacher/contentresultsetwrapper.hxx 
b/ucb/source/cacher/contentresultsetwrapper.hxx
index abb1bd51d4c4..254ab530606d 100644
--- a/ucb/source/cacher/contentresultsetwrapper.hxx
+++ b/ucb/source/cacher/contentresultsetwrapper.hxx
@@ -32,6 +32,7 @@
 #include <com/sun/star/beans/XPropertySet.hpp>
 #include <cppuhelper/interfacecontainer.h>
 #include <comphelper/interfacecontainer2.hxx>
+#include <comphelper/multiinterfacecontainer2.hxx>
 #include <memory>
 
 
@@ -47,7 +48,7 @@ class ContentResultSetWrapper
                 , public css::sdbc::XRow
 {
 protected:
-    typedef cppu::OMultiTypeInterfaceContainerHelperVar<OUString>
+    typedef comphelper::OMultiTypeInterfaceContainerHelperVar2<OUString>
         PropertyChangeListenerContainer_Impl;
 
     //members
diff --git a/ucb/source/core/ucbstore.cxx b/ucb/source/core/ucbstore.cxx
index 924892beb8ca..223f66dc34bb 100644
--- a/ucb/source/core/ucbstore.cxx
+++ b/ucb/source/core/ucbstore.cxx
@@ -1901,12 +1901,12 @@ void PersistentPropertySet::notifyPropertyChangeEvent(
                                     const PropertyChangeEvent& rEvent ) const
 {
     // Get "normal" listeners for the property.
-    OInterfaceContainerHelper* pContainer =
+    OInterfaceContainerHelper2* pContainer =
             m_pPropertyChangeListeners->getContainer(
                                                     rEvent.PropertyName );
     if ( pContainer && pContainer->getLength() )
     {
-        OInterfaceIteratorHelper aIter( *pContainer );
+        OInterfaceIteratorHelper2 aIter( *pContainer );
         while ( aIter.hasMoreElements() )
         {
             // Propagate event.
@@ -1915,11 +1915,11 @@ void PersistentPropertySet::notifyPropertyChangeEvent(
     }
 
     // Get "normal" listeners for all properties.
-    OInterfaceContainerHelper* pNoNameContainer =
+    OInterfaceContainerHelper2* pNoNameContainer =
             m_pPropertyChangeListeners->getContainer( OUString() );
     if ( pNoNameContainer && pNoNameContainer->getLength() )
     {
-        OInterfaceIteratorHelper aIter( *pNoNameContainer );
+        OInterfaceIteratorHelper2 aIter( *pNoNameContainer );
         while ( aIter.hasMoreElements() )
         {
             // Propagate event.
diff --git a/ucb/source/core/ucbstore.hxx b/ucb/source/core/ucbstore.hxx
index 478d4d597d60..a7642b9a6a1b 100644
--- a/ucb/source/core/ucbstore.hxx
+++ b/ucb/source/core/ucbstore.hxx
@@ -34,6 +34,7 @@
 #include <com/sun/star/lang/XComponent.hpp>
 #include <com/sun/star/lang/XInitialization.hpp>
 #include <comphelper/interfacecontainer2.hxx>
+#include <comphelper/multiinterfacecontainer2.hxx>
 #include <cppuhelper/compbase.hxx>
 #include <cppuhelper/basemutex.hxx>
 #include <unordered_map>
@@ -142,7 +143,7 @@ public:
 
 
 class PropertySetInfo_Impl;
-typedef cppu::OMultiTypeInterfaceContainerHelperVar<OUString> 
PropertyListeners_Impl;
+typedef comphelper::OMultiTypeInterfaceContainerHelperVar2<OUString> 
PropertyListeners_Impl;
 
 class PersistentPropertySet : public cppu::WeakImplHelper <
     css::lang::XServiceInfo,
diff --git a/ucb/source/sorter/sortresult.cxx b/ucb/source/sorter/sortresult.cxx
index 94e6570cb864..606ecf7264b8 100644
--- a/ucb/source/sorter/sortresult.cxx
+++ b/ucb/source/sorter/sortresult.cxx
@@ -28,6 +28,7 @@
 #include <cppuhelper/implbase.hxx>
 #include <cppuhelper/interfacecontainer.hxx>
 #include <comphelper/interfacecontainer2.hxx>
+#include <comphelper/multiinterfacecontainer2.hxx>
 #include <cppuhelper/supportsservice.hxx>
 #include <tools/diagnose_ex.h>
 #include <memory>
@@ -93,7 +94,7 @@ public:
     virtual sal_Bool SAL_CALL hasPropertyByName( const OUString& Name ) 
override;
 };
 
-typedef OMultiTypeInterfaceContainerHelperVar<OUString>
+typedef comphelper::OMultiTypeInterfaceContainerHelperVar2<OUString>
     PropertyChangeListenerContainer_Impl;
 
 class PropertyChangeListeners_Impl : public 
PropertyChangeListenerContainer_Impl
@@ -1193,11 +1194,11 @@ void SortedResultSet::PropertyChanged( const 
PropertyChangeEvent& rEvt )
         return;
 
     // Notify listeners interested especially in the changed property.
-    OInterfaceContainerHelper* pPropsContainer =
+    OInterfaceContainerHelper2* pPropsContainer =
             mpPropChangeListeners->getContainer( rEvt.PropertyName );
     if ( pPropsContainer )
     {
-        OInterfaceIteratorHelper aIter( *pPropsContainer );
+        OInterfaceIteratorHelper2 aIter( *pPropsContainer );
         while ( aIter.hasMoreElements() )
         {
             static_cast< XPropertyChangeListener* >( aIter.next() 
)->propertyChange( rEvt );
@@ -1208,7 +1209,7 @@ void SortedResultSet::PropertyChanged( const 
PropertyChangeEvent& rEvt )
     pPropsContainer = mpPropChangeListeners->getContainer( OUString() );
     if ( pPropsContainer )
     {
-        OInterfaceIteratorHelper aIter( *pPropsContainer );
+        OInterfaceIteratorHelper2 aIter( *pPropsContainer );
         while ( aIter.hasMoreElements() )
         {
             static_cast< XPropertyChangeListener* >( aIter.next() 
)->propertyChange( rEvt );
diff --git a/ucb/source/ucp/file/bc.cxx b/ucb/source/ucp/file/bc.cxx
index 07c3d846a35f..b21ba9f40175 100644
--- a/ucb/source/ucp/file/bc.cxx
+++ b/ucb/source/ucp/file/bc.cxx
@@ -32,6 +32,7 @@
 #include <com/sun/star/io/XActiveDataSink.hpp>
 #include <com/sun/star/ucb/NameClash.hpp>
 #include <comphelper/fileurl.hxx>
+#include <comphelper/multiinterfacecontainer2.hxx>
 #include <cppuhelper/interfacecontainer.hxx>
 #include <cppuhelper/supportsservice.hxx>
 #include "filglob.hxx"
@@ -53,7 +54,7 @@ using namespace com::sun::star::ucb;
 #define THROW_WHERE ""
 #endif
 
-typedef cppu::OMultiTypeInterfaceContainerHelperVar<OUString>
+typedef comphelper::OMultiTypeInterfaceContainerHelperVar2<OUString>
     PropertyListeners_impl;
 
 class fileaccess::PropertyListeners
@@ -1154,16 +1155,16 @@ BaseContent::cPCL()
     if (!m_pPropertyListener)
         return nullptr;
 
-    const Sequence< OUString > seqNames = 
m_pPropertyListener->getContainedTypes();
+    const std::vector< OUString > seqNames = 
m_pPropertyListener->getContainedTypes();
 
     std::unique_ptr<PropertyChangeNotifier> p;
 
-    if( seqNames.hasElements() )
+    if( !seqNames.empty() )
     {
         ListenerMap listener;
         for( const auto& rName : seqNames )
         {
-            cppu::OInterfaceContainerHelper* pContainer = 
m_pPropertyListener->getContainer(rName);
+            comphelper::OInterfaceContainerHelper2* pContainer = 
m_pPropertyListener->getContainer(rName);
             if (!pContainer)
                 continue;
             listener[rName] = pContainer->getElements();
diff --git a/ucb/source/ucp/file/filnot.cxx b/ucb/source/ucp/file/filnot.cxx
index d1f1b830bf95..93d1d5f21f1f 100644
--- a/ucb/source/ucp/file/filnot.cxx
+++ b/ucb/source/ucp/file/filnot.cxx
@@ -214,7 +214,7 @@ void PropertyChangeNotifier::notifyPropertyChanged(
 
     // notify listeners for all Events
 
-    uno::Sequence< uno::Reference< uno::XInterface > > seqList = m_aListeners[ 
OUString() ];
+    std::vector< uno::Reference< uno::XInterface > >& seqList = m_aListeners[ 
OUString() ];
     for( const auto& rListener : std::as_const(seqList) )
     {
         uno::Reference< beans::XPropertiesChangeListener > aListener( 
rListener,uno::UNO_QUERY );
diff --git a/ucb/source/ucp/file/filnot.hxx b/ucb/source/ucp/file/filnot.hxx
index 76730c1ddcfa..daeffb8b11ba 100644
--- a/ucb/source/ucp/file/filnot.hxx
+++ b/ucb/source/ucp/file/filnot.hxx
@@ -77,7 +77,7 @@ namespace fileaccess {
 
 
     typedef std::unordered_map< OUString,
-                           css::uno::Sequence< css::uno::Reference< 
css::uno::XInterface > > >  ListenerMap;
+                           std::vector< css::uno::Reference< 
css::uno::XInterface > > >  ListenerMap;
 
     class PropertyChangeNotifier
     {

Reply via email to