[Libreoffice-commits] core.git: animations/Library_animcore.mk animations/source avmedia/source basic/source chart2/inc chart2/source comphelper/CppunitTest_comphelper_ifcontainer.mk comphelper/CppunitTest_comphelper_test.mk comphelper/Library_comphelper.mk comphelper/Module_comphelper.mk comphelper/qa comphelper/source connectivity/source dbaccess/source dtrans/source embeddedobj/source embedserv/source extensions/source forms/source fpicker/source framework/source include/comphelper include/connectivity include/editeng include/linguistic include/svx include/toolkit io/Library_io.mk io/source lingucomponent/Library_hyphen.mk lingucomponent/Library_spell.mk lingucomponent/source linguistic/source linguistic/workben package/inc package/source reportdesign/source sc/inc scripting/Library_stringresource.mk scripting/source sc/source sd/source sfx2/source slideshow/source slideshow/test sot/source svl/source svtools/source svx/source sw/inc sw/source toolkit/source ucbhelper/source ucb/Library_srtrs1 .mk ucb/source xmlhelp/source

Noel Grandin noelgrandin at gmail.com
Sun Jan 24 22:53:42 PST 2016


 animations/Library_animcore.mk                                             |    1 
 animations/source/animcore/animcore.cxx                                    |   10 
 avmedia/source/win/window.cxx                                              |    8 
 basic/source/classes/sbunoobj.cxx                                          |    4 
 basic/source/inc/namecont.hxx                                              |    6 
 chart2/inc/ChartModel.hxx                                                  |    4 
 chart2/source/controller/chartapiwrapper/AreaWrapper.hxx                   |    4 
 chart2/source/controller/chartapiwrapper/AxisWrapper.hxx                   |    4 
 chart2/source/controller/chartapiwrapper/ChartDataWrapper.cxx              |   11 
 chart2/source/controller/chartapiwrapper/ChartDataWrapper.hxx              |    4 
 chart2/source/controller/chartapiwrapper/DataSeriesPointWrapper.hxx        |    4 
 chart2/source/controller/chartapiwrapper/DiagramWrapper.hxx                |    2 
 chart2/source/controller/chartapiwrapper/GridWrapper.hxx                   |    4 
 chart2/source/controller/chartapiwrapper/LegendWrapper.hxx                 |    4 
 chart2/source/controller/chartapiwrapper/MinMaxLineWrapper.hxx             |    4 
 chart2/source/controller/chartapiwrapper/TitleWrapper.hxx                  |    2 
 chart2/source/controller/chartapiwrapper/UpDownBarWrapper.hxx              |    4 
 chart2/source/controller/chartapiwrapper/WallFloorWrapper.hxx              |    4 
 chart2/source/controller/main/CommandDispatch.cxx                          |    4 
 chart2/source/controller/main/CommandDispatch.hxx                          |    3 
 chart2/source/model/main/ChartModel.cxx                                    |    6 
 comphelper/CppunitTest_comphelper_ifcontainer.mk                           |   29 
 comphelper/CppunitTest_comphelper_test.mk                                  |    1 
 comphelper/Library_comphelper.mk                                           |    1 
 comphelper/Module_comphelper.mk                                            |    1 
 comphelper/qa/container/comphelper_ifcontainer.cxx                         |  212 ++++++
 comphelper/qa/container/testifcontainer.cxx                                |  145 ++++
 comphelper/source/container/interfacecontainer2.cxx                        |  307 ++++++++++
 comphelper/source/eventattachermgr/eventattachermgr.cxx                    |    8 
 comphelper/source/misc/accessibleeventnotifier.cxx                         |   19 
 comphelper/source/misc/instancelocker.cxx                                  |    2 
 comphelper/source/misc/instancelocker.hxx                                  |    4 
 comphelper/source/misc/listenernotification.cxx                            |    4 
 comphelper/source/property/opropertybag.hxx                                |    3 
 connectivity/source/commontools/parameters.cxx                             |    2 
 connectivity/source/drivers/hsqldb/HTables.cxx                             |    2 
 connectivity/source/drivers/mysql/YTables.cxx                              |    2 
 connectivity/source/inc/hsqldb/HConnection.hxx                             |    4 
 connectivity/source/sdbcx/VCollection.cxx                                  |    4 
 dbaccess/source/core/api/RowSet.cxx                                        |   19 
 dbaccess/source/core/api/RowSet.hxx                                        |    7 
 dbaccess/source/core/dataaccess/bookmarkcontainer.cxx                      |    6 
 dbaccess/source/core/dataaccess/bookmarkcontainer.hxx                      |    4 
 dbaccess/source/core/dataaccess/databasecontext.hxx                        |    2 
 dbaccess/source/core/dataaccess/databasedocument.hxx                       |    6 
 dbaccess/source/core/dataaccess/databaseregistrations.cxx                  |    4 
 dbaccess/source/core/dataaccess/datasource.hxx                             |    2 
 dbaccess/source/core/dataaccess/definitioncontainer.cxx                    |    2 
 dbaccess/source/core/dataaccess/documenteventnotifier.cxx                  |    6 
 dbaccess/source/core/dataaccess/intercept.hxx                              |    2 
 dbaccess/source/core/inc/ContentHelper.hxx                                 |    3 
 dbaccess/source/core/inc/definitioncontainer.hxx                           |    4 
 dbaccess/source/ui/app/AppController.cxx                                   |    4 
 dbaccess/source/ui/app/AppController.hxx                                   |    5 
 dbaccess/source/ui/browser/brwctrlr.cxx                                    |    6 
 dbaccess/source/ui/browser/exsrcbrw.cxx                                    |    2 
 dbaccess/source/ui/browser/formadapter.cxx                                 |   10 
 dbaccess/source/ui/browser/sbamultiplex.cxx                                |    4 
 dbaccess/source/ui/browser/unodatbr.cxx                                    |    2 
 dbaccess/source/ui/control/dbtreelistbox.cxx                               |    6 
 dbaccess/source/ui/inc/callbacks.hxx                                       |    4 
 dbaccess/source/ui/inc/exsrcbrw.hxx                                        |    2 
 dbaccess/source/ui/inc/formadapter.hxx                                     |    4 
 dbaccess/source/ui/inc/sbamultiplex.hxx                                    |   11 
 dbaccess/source/ui/inc/unodatbr.hxx                                        |    6 
 dbaccess/source/ui/misc/dbsubcomponentcontroller.cxx                       |    3 
 dbaccess/source/ui/uno/copytablewizard.cxx                                 |    5 
 dtrans/source/win32/clipb/WinClipboard.cxx                                 |    2 
 dtrans/source/win32/dnd/sourcecontext.cxx                                  |    4 
 dtrans/source/win32/dnd/target.cxx                                         |   10 
 embeddedobj/source/commonembedding/embedobj.cxx                            |    1 
 embeddedobj/source/general/intercept.cxx                                   |    1 
 embeddedobj/source/inc/intercept.hxx                                       |    4 
 embeddedobj/source/msole/olecomponent.cxx                                  |    4 
 embeddedobj/source/msole/olemisc.cxx                                       |    2 
 embedserv/source/embed/intercept.cxx                                       |    4 
 embedserv/source/inc/intercept.hxx                                         |    2 
 embedserv/source/inc/xwin.hxx                                              |    2 
 extensions/source/bibliography/datman.hxx                                  |    4 
 extensions/source/logging/logger.cxx                                       |    4 
 extensions/source/propctrlr/eformshelper.cxx                               |    4 
 extensions/source/propctrlr/formgeometryhandler.cxx                        |    2 
 extensions/source/propctrlr/genericpropertyhandler.cxx                     |    4 
 extensions/source/propctrlr/genericpropertyhandler.hxx                     |    2 
 extensions/source/propctrlr/propcontroller.hxx                             |    4 
 extensions/source/propctrlr/propertyhandler.cxx                            |    4 
 extensions/source/propctrlr/standardcontrol.hxx                            |    2 
 forms/source/component/Button.cxx                                          |    2 
 forms/source/component/DatabaseForm.cxx                                    |   12 
 forms/source/component/DatabaseForm.hxx                                    |    8 
 forms/source/component/Edit.hxx                                            |    2 
 forms/source/component/File.cxx                                            |    2 
 forms/source/component/File.hxx                                            |    2 
 forms/source/component/Filter.cxx                                          |    4 
 forms/source/component/FormComponent.cxx                                   |    2 
 forms/source/component/Grid.cxx                                            |    2 
 forms/source/component/Grid.hxx                                            |    2 
 forms/source/component/ImageControl.hxx                                    |    2 
 forms/source/component/ListBox.hxx                                         |    4 
 forms/source/component/clickableimage.cxx                                  |    2 
 forms/source/component/clickableimage.hxx                                  |    6 
 forms/source/component/entrylisthelper.hxx                                 |    4 
 forms/source/component/errorbroadcaster.cxx                                |    2 
 forms/source/component/errorbroadcaster.hxx                                |    5 
 forms/source/helper/resettable.cxx                                         |    2 
 forms/source/inc/FormComponent.hxx                                         |    4 
 forms/source/inc/InterfaceContainer.hxx                                    |    4 
 forms/source/inc/resettable.hxx                                            |    4 
 forms/source/misc/InterfaceContainer.cxx                                   |    2 
 forms/source/richtext/attributedispatcher.cxx                              |    2 
 forms/source/richtext/featuredispatcher.cxx                                |    2 
 forms/source/richtext/featuredispatcher.hxx                                |    6 
 forms/source/richtext/richtextmodel.hxx                                    |    2 
 fpicker/source/win32/filepicker/FilePicker.cxx                             |    2 
 fpicker/source/win32/filepicker/VistaFilePickerEventHandler.cxx            |    2 
 fpicker/source/win32/filepicker/asynceventnotifier.cxx                     |    2 
 framework/source/fwe/helper/undomanagerhelper.cxx                          |    6 
 framework/source/services/frame.cxx                                        |    2 
 include/comphelper/interfacecontainer2.hxx                                 |  304 +++++++++
 include/comphelper/listenernotification.hxx                                |    8 
 include/connectivity/parameters.hxx                                        |    4 
 include/connectivity/sdbcx/VCollection.hxx                                 |    6 
 include/editeng/unotext.hxx                                                |    4 
 include/linguistic/lngprophelp.hxx                                         |    4 
 include/svx/fmgridif.hxx                                                   |   22 
 include/toolkit/awt/vclxtopwindow.hxx                                      |    4 
 include/toolkit/awt/vclxwindow.hxx                                         |    4 
 include/toolkit/controls/controlmodelcontainerbase.hxx                     |    2 
 include/toolkit/controls/unocontrol.hxx                                    |    2 
 include/toolkit/controls/unocontrols.hxx                                   |    2 
 include/toolkit/helper/listenermultiplexer.hxx                             |    4 
 include/toolkit/helper/macros.hxx                                          |    4 
 io/Library_io.mk                                                           |    1 
 io/source/stm/opump.cxx                                                    |   13 
 lingucomponent/Library_hyphen.mk                                           |    1 
 lingucomponent/Library_spell.mk                                            |    1 
 lingucomponent/source/hyphenator/hyphen/hyphenimp.hxx                      |    2 
 lingucomponent/source/spellcheck/macosxspell/macspellimp.hxx               |    2 
 lingucomponent/source/spellcheck/spell/sspellimp.hxx                       |    2 
 lingucomponent/source/thesaurus/libnth/nthesimp.hxx                        |    2 
 linguistic/source/convdic.cxx                                              |    8 
 linguistic/source/convdic.hxx                                              |    4 
 linguistic/source/convdiclist.hxx                                          |    2 
 linguistic/source/dicimp.cxx                                               |    8 
 linguistic/source/dicimp.hxx                                               |    4 
 linguistic/source/dlistimp.cxx                                             |   10 
 linguistic/source/dlistimp.hxx                                             |    2 
 linguistic/source/gciterator.hxx                                           |    4 
 linguistic/source/lngopt.hxx                                               |    3 
 linguistic/source/lngprophelp.cxx                                          |    8 
 linguistic/source/lngsvcmgr.cxx                                            |   30 
 linguistic/source/lngsvcmgr.hxx                                            |    4 
 linguistic/workben/sprophelp.hxx                                           |    2 
 linguistic/workben/sspellimp.hxx                                           |    2 
 package/inc/zipfileaccess.hxx                                              |    4 
 package/source/xstor/ocompinstream.cxx                                     |    2 
 package/source/xstor/ocompinstream.hxx                                     |    4 
 package/source/zippackage/zipfileaccess.cxx                                |    2 
 reportdesign/source/core/api/ReportDefinition.cxx                          |   10 
 reportdesign/source/core/inc/Functions.hxx                                 |    3 
 reportdesign/source/core/inc/Groups.hxx                                    |    3 
 reportdesign/source/core/inc/ReportControlModel.hxx                        |    4 
 reportdesign/source/core/inc/Section.hxx                                   |    3 
 reportdesign/source/ui/inc/ReportController.hxx                            |    3 
 sc/inc/docuno.hxx                                                          |    4 
 sc/inc/fielduno.hxx                                                        |    5 
 sc/source/ui/Accessibility/DrawModelBroadcaster.cxx                        |    2 
 sc/source/ui/inc/DrawModelBroadcaster.hxx                                  |    4 
 sc/source/ui/unoobj/celllistsource.cxx                                     |    2 
 sc/source/ui/unoobj/celllistsource.hxx                                     |    3 
 sc/source/ui/unoobj/cellvaluebinding.cxx                                   |    2 
 sc/source/ui/unoobj/cellvaluebinding.hxx                                   |    3 
 sc/source/ui/unoobj/docuno.cxx                                             |    2 
 sc/source/ui/unoobj/fielduno.cxx                                           |   68 --
 scripting/Library_stringresource.mk                                        |    1 
 scripting/source/stringresource/stringresource.cxx                         |    2 
 scripting/source/stringresource/stringresource.hxx                         |    4 
 sd/source/core/stlsheet.cxx                                                |    7 
 sd/source/ui/slideshow/slideshowimpl.cxx                                   |    2 
 sd/source/ui/slideshow/slideshowimpl.hxx                                   |    3 
 sd/source/ui/unoidl/unocpres.hxx                                           |    4 
 sfx2/source/doc/SfxDocumentMetaData.cxx                                    |   11 
 sfx2/source/notify/globalevents.cxx                                        |    6 
 sfx2/source/view/sfxbasecontroller.cxx                                     |    2 
 sfx2/source/view/userinputinterception.cxx                                 |   10 
 sfx2/source/view/viewimp.hxx                                               |    4 
 sfx2/source/view/viewsh.cxx                                                |    4 
 slideshow/source/engine/slide/shapemanagerimpl.cxx                         |    2 
 slideshow/source/engine/slide/shapemanagerimpl.hxx                         |    2 
 slideshow/source/engine/slideshowimpl.cxx                                  |    6 
 slideshow/source/inc/shapemaps.hxx                                         |    4 
 slideshow/test/demoshow.cxx                                                |    8 
 sot/source/unoolestorage/xolesimplestorage.cxx                             |    2 
 sot/source/unoolestorage/xolesimplestorage.hxx                             |    5 
 svl/source/fsstor/fsstorage.cxx                                            |    4 
 svl/source/fsstor/oinputstreamcontainer.cxx                                |    2 
 svl/source/fsstor/oinputstreamcontainer.hxx                                |    4 
 svl/source/fsstor/ostreamcontainer.cxx                                     |    2 
 svl/source/fsstor/ostreamcontainer.hxx                                     |    4 
 svtools/source/hatchwindow/documentcloser.cxx                              |    6 
 svx/source/accessibility/AccessibleFrameSelector.cxx                       |    2 
 svx/source/fmcomp/fmgridif.cxx                                             |   14 
 svx/source/fmcomp/gridcell.cxx                                             |    4 
 svx/source/form/formcontroller.cxx                                         |   12 
 svx/source/form/formfeaturedispatcher.cxx                                  |    2 
 svx/source/inc/AccessibleFrameSelector.hxx                                 |    6 
 svx/source/inc/formcontroller.hxx                                          |    3 
 svx/source/inc/formfeaturedispatcher.hxx                                   |    4 
 svx/source/inc/gridcell.hxx                                                |   25 
 svx/source/unodialogs/textconversiondlgs/chinese_translation_unodialog.hxx |    3 
 svx/source/unodraw/unoshape.cxx                                            |    2 
 svx/source/unodraw/unoshcol.cxx                                            |    7 
 sw/inc/unochart.hxx                                                        |   14 
 sw/inc/unotbl.hxx                                                          |    4 
 sw/source/core/access/accmap.cxx                                           |    5 
 sw/source/core/unocore/unobkm.cxx                                          |    6 
 sw/source/core/unocore/unochart.cxx                                        |    4 
 sw/source/core/unocore/unofield.cxx                                        |   12 
 sw/source/core/unocore/unoframe.cxx                                        |    4 
 sw/source/core/unocore/unoftn.cxx                                          |    8 
 sw/source/core/unocore/unoidx.cxx                                          |    7 
 sw/source/core/unocore/unoparagraph.cxx                                    |    6 
 sw/source/core/unocore/unorefmk.cxx                                        |   10 
 sw/source/core/unocore/unosect.cxx                                         |    6 
 sw/source/core/unocore/unotbl.cxx                                          |   19 
 sw/source/uibase/inc/unomailmerge.hxx                                      |    7 
 sw/source/uibase/inc/unotxvw.hxx                                           |    5 
 sw/source/uibase/uno/unomailmerge.cxx                                      |    2 
 sw/source/uibase/uno/unotxdoc.cxx                                          |    4 
 toolkit/source/awt/stylesettings.cxx                                       |    2 
 toolkit/source/awt/vclxtoolkit.cxx                                         |   24 
 toolkit/source/awt/vclxtopwindow.cxx                                       |    2 
 toolkit/source/awt/vclxwindow.cxx                                          |   20 
 toolkit/source/controls/controlmodelcontainerbase.cxx                      |   10 
 toolkit/source/controls/grid/defaultgridcolumnmodel.cxx                    |    3 
 toolkit/source/controls/tree/treecontrol.cxx                               |    4 
 toolkit/source/helper/listenermultiplexer.cxx                              |    4 
 ucb/Library_srtrs1.mk                                                      |    1 
 ucb/source/cacher/contentresultsetwrapper.cxx                              |    3 
 ucb/source/cacher/contentresultsetwrapper.hxx                              |    3 
 ucb/source/cacher/dynamicresultsetwrapper.cxx                              |    4 
 ucb/source/cacher/dynamicresultsetwrapper.hxx                              |    3 
 ucb/source/core/ucb.cxx                                                    |    6 
 ucb/source/core/ucb.hxx                                                    |    4 
 ucb/source/core/ucbstore.cxx                                               |   12 
 ucb/source/sorter/sortdynres.cxx                                           |    6 
 ucb/source/sorter/sortdynres.hxx                                           |    6 
 ucb/source/sorter/sortresult.cxx                                           |    4 
 ucb/source/sorter/sortresult.hxx                                           |    6 
 ucb/source/ucp/file/bc.cxx                                                 |   14 
 ucb/source/ucp/file/bc.hxx                                                 |    8 
 ucb/source/ucp/file/filnot.cxx                                             |   30 
 ucb/source/ucp/file/filnot.hxx                                             |   11 
 ucb/source/ucp/file/filrset.cxx                                            |   18 
 ucb/source/ucp/file/filrset.hxx                                            |    8 
 ucb/source/ucp/ftp/ftpresultsetbase.cxx                                    |    6 
 ucb/source/ucp/ftp/ftpresultsetbase.hxx                                    |    8 
 ucb/source/ucp/hierarchy/hierarchydatasource.cxx                           |    4 
 ucb/source/ucp/hierarchy/hierarchydatasource.hxx                           |    4 
 ucbhelper/source/provider/resultset.cxx                                    |    9 
 ucbhelper/source/provider/resultsethelper.cxx                              |    2 
 xmlhelp/source/cxxhelp/provider/resultsetbase.cxx                          |    6 
 xmlhelp/source/cxxhelp/provider/resultsetbase.hxx                          |    8 
 263 files changed, 1655 insertions(+), 707 deletions(-)

New commits:
commit 752cd07d085ac0aadc99bd512d49072843139032
Author: Noel Grandin <noelgrandin at gmail.com>
Date:   Tue Jan 19 19:45:45 2016 +0200

    InterfaceContainer2 with vector instead of Sequence
    
    create an InterfaceContainer2 class to replace InterfaceContainer.
    It uses a std::vector instead of a Sequence for the mutable listener
    list, which provides far better performance.
    
    Switch all our internal use-sites to the new class.
    
    Change-Id: I6b56cfa511ded2395faa22e68fab3b2f16c3cb88

diff --git a/animations/Library_animcore.mk b/animations/Library_animcore.mk
index f0fca83..6246d57 100644
--- a/animations/Library_animcore.mk
+++ b/animations/Library_animcore.mk
@@ -26,6 +26,7 @@ $(eval $(call gb_Library_set_componentfile,animcore,animations/source/animcore/a
 $(eval $(call gb_Library_use_sdk_api,animcore))
 
 $(eval $(call gb_Library_use_libraries,animcore,\
+	comphelper \
     cppu \
 	cppuhelper \
     sal \
diff --git a/animations/source/animcore/animcore.cxx b/animations/source/animcore/animcore.cxx
index ab1bf53..e4771a1 100644
--- a/animations/source/animcore/animcore.cxx
+++ b/animations/source/animcore/animcore.cxx
@@ -47,7 +47,7 @@
 #include <com/sun/star/lang/XUnoTunnel.hpp>
 #include <comphelper/servicehelper.hxx>
 #include <cppuhelper/queryinterface.hxx>
-#include <cppuhelper/interfacecontainer.hxx>
+#include <comphelper/interfacecontainer2.hxx>
 #include <cppuhelper/supportsservice.hxx>
 #include <cppuhelper/weakref.hxx>
 
@@ -60,8 +60,8 @@
 
 using ::osl::Mutex;
 using ::osl::Guard;
-using ::cppu::OInterfaceContainerHelper;
-using ::cppu::OInterfaceIteratorHelper;
+using ::comphelper::OInterfaceContainerHelper2;
+using ::comphelper::OInterfaceIteratorHelper2;
 using ::com::sun::star::uno::Any;
 using ::com::sun::star::uno::UNO_QUERY;
 using ::com::sun::star::uno::XInterface;
@@ -287,7 +287,7 @@ public:
     void fireChangeListener();
 
 private:
-    OInterfaceContainerHelper   maChangeListener;
+    OInterfaceContainerHelper2   maChangeListener;
 
     static void initTypeProvider( sal_Int16 nNodeType ) throw();
 
@@ -2129,7 +2129,7 @@ void AnimationNode::fireChangeListener()
 {
     Guard< Mutex > aGuard( maMutex );
 
-    OInterfaceIteratorHelper aIterator( maChangeListener );
+    OInterfaceIteratorHelper2 aIterator( maChangeListener );
     if( aIterator.hasMoreElements() )
     {
         Reference< XInterface > xSource( static_cast<OWeakObject*>(this), UNO_QUERY );
diff --git a/avmedia/source/win/window.cxx b/avmedia/source/win/window.cxx
index a53a87c..7dc04ed 100644
--- a/avmedia/source/win/window.cxx
+++ b/avmedia/source/win/window.cxx
@@ -532,7 +532,7 @@ void SAL_CALL Window::removeEventListener( const uno::Reference< lang::XEventLis
 
 void Window::fireMousePressedEvent( const css::awt::MouseEvent& rEvt )
 {
-    ::cppu::OInterfaceContainerHelper* pContainer = maListeners.getContainer( cppu::UnoType<awt::XMouseListener>::get());
+    ::comphelper::OInterfaceContainerHelper2* pContainer = maListeners.getContainer( cppu::UnoType<awt::XMouseListener>::get());
 
     if( pContainer )
     {
@@ -545,7 +545,7 @@ void Window::fireMousePressedEvent( const css::awt::MouseEvent& rEvt )
 
 void Window::fireMouseReleasedEvent( const css::awt::MouseEvent& rEvt )
 {
-    ::cppu::OInterfaceContainerHelper* pContainer = maListeners.getContainer( cppu::UnoType<awt::XMouseListener>::get());
+    ::comphelper::OInterfaceContainerHelper2* pContainer = maListeners.getContainer( cppu::UnoType<awt::XMouseListener>::get());
 
     if( pContainer )
     {
@@ -558,7 +558,7 @@ void Window::fireMouseReleasedEvent( const css::awt::MouseEvent& rEvt )
 
 void Window::fireMouseMovedEvent( const css::awt::MouseEvent& rEvt )
 {
-    ::cppu::OInterfaceContainerHelper* pContainer = maListeners.getContainer( cppu::UnoType<awt::XMouseMotionListener>::get());
+    ::comphelper::OInterfaceContainerHelper2* pContainer = maListeners.getContainer( cppu::UnoType<awt::XMouseMotionListener>::get());
 
     if( pContainer )
     {
@@ -571,7 +571,7 @@ void Window::fireMouseMovedEvent( const css::awt::MouseEvent& rEvt )
 
 void Window::fireSetFocusEvent( const css::awt::FocusEvent& rEvt )
 {
-    ::cppu::OInterfaceContainerHelper* pContainer = maListeners.getContainer( cppu::UnoType<awt::XFocusListener>::get());
+    ::comphelper::OInterfaceContainerHelper2* pContainer = maListeners.getContainer( cppu::UnoType<awt::XFocusListener>::get());
 
     if( pContainer )
     {
diff --git a/basic/source/classes/sbunoobj.cxx b/basic/source/classes/sbunoobj.cxx
index 0038dbc..da309e7 100644
--- a/basic/source/classes/sbunoobj.cxx
+++ b/basic/source/classes/sbunoobj.cxx
@@ -25,7 +25,7 @@
 #include <cppuhelper/implbase.hxx>
 #include <cppuhelper/exc_hlp.hxx>
 #include <cppuhelper/typeprovider.hxx>
-#include <cppuhelper/interfacecontainer.hxx>
+#include <comphelper/interfacecontainer2.hxx>
 #include <comphelper/extract.hxx>
 #include <comphelper/processfactory.hxx>
 
@@ -4297,7 +4297,7 @@ class ModuleInvocationProxy : public WeakImplHelper< XInvocation, XComponent >
     SbxObjectRef        m_xScopeObj;
     bool                m_bProxyIsClassModuleObject;
 
-    ::cppu::OInterfaceContainerHelper m_aListeners;
+    ::comphelper::OInterfaceContainerHelper2 m_aListeners;
 
 public:
     ModuleInvocationProxy( const OUString& aPrefix, SbxObjectRef xScopeObj );
diff --git a/basic/source/inc/namecont.hxx b/basic/source/inc/namecont.hxx
index cdc8a65..0978c1d 100644
--- a/basic/source/inc/namecont.hxx
+++ b/basic/source/inc/namecont.hxx
@@ -79,8 +79,8 @@ class NameContainer : public ::cppu::BaseMutex, public NameContainer_BASE
     css::uno::Type mType;
     css::uno::XInterface* mpxEventSource;
 
-    ::cppu::OInterfaceContainerHelper maContainerListeners;
-    ::cppu::OInterfaceContainerHelper maChangesListeners;
+    ::comphelper::OInterfaceContainerHelper2 maContainerListeners;
+    ::comphelper::OInterfaceContainerHelper2 maChangesListeners;
 
 public:
     NameContainer( const css::uno::Type& rType )
@@ -157,7 +157,7 @@ public:
 class ModifiableHelper
 {
 private:
-    ::cppu::OInterfaceContainerHelper   m_aModifyListeners;
+    ::comphelper::OInterfaceContainerHelper2   m_aModifyListeners;
     ::cppu::OWeakObject&                m_rEventSource;
     bool                                mbModified;
 
diff --git a/chart2/inc/ChartModel.hxx b/chart2/inc/ChartModel.hxx
index 41c6f33..b473205 100644
--- a/chart2/inc/ChartModel.hxx
+++ b/chart2/inc/ChartModel.hxx
@@ -60,7 +60,7 @@
 #include <osl/mutex.hxx>
 #include <rtl/ref.hxx>
 #include <cppuhelper/implbase.hxx>
-#include <cppuhelper/interfacecontainer.hxx>
+#include <comphelper/interfacecontainer2.hxx>
 #include <svtools/grfmgr.hxx>
 
 #include <memory>
@@ -130,7 +130,7 @@ private:
     ::com::sun::star::uno::Reference< ::com::sun::star::document::XDocumentProperties > m_xDocumentProperties;
     ::rtl::Reference< UndoManager >                                             m_pUndoManager;
 
-    ::cppu::OInterfaceContainerHelper                                           m_aControllers;
+    ::comphelper::OInterfaceContainerHelper2                                           m_aControllers;
     ::com::sun::star::uno::Reference< ::com::sun::star::frame::XController >    m_xCurrentController;
     sal_uInt16                                                                  m_nControllerLockCount;
 
diff --git a/chart2/source/controller/chartapiwrapper/AreaWrapper.hxx b/chart2/source/controller/chartapiwrapper/AreaWrapper.hxx
index ec0d858..6ba98ac 100644
--- a/chart2/source/controller/chartapiwrapper/AreaWrapper.hxx
+++ b/chart2/source/controller/chartapiwrapper/AreaWrapper.hxx
@@ -22,7 +22,7 @@
 #include "WrappedPropertySet.hxx"
 #include <cppuhelper/implbase.hxx>
 #include <comphelper/uno3.hxx>
-#include <cppuhelper/interfacecontainer.hxx>
+#include <comphelper/interfacecontainer2.hxx>
 #include <com/sun/star/drawing/XShape.hpp>
 #include <com/sun/star/lang/XComponent.hpp>
 #include <com/sun/star/lang/XServiceInfo.hpp>
@@ -94,7 +94,7 @@ protected:
 
 private:
     std::shared_ptr< Chart2ModelContact >   m_spChart2ModelContact;
-    ::cppu::OInterfaceContainerHelper           m_aEventListenerContainer;
+    ::comphelper::OInterfaceContainerHelper2      m_aEventListenerContainer;
 };
 
 } //  namespace wrapper
diff --git a/chart2/source/controller/chartapiwrapper/AxisWrapper.hxx b/chart2/source/controller/chartapiwrapper/AxisWrapper.hxx
index bc518df..e0dcf25 100644
--- a/chart2/source/controller/chartapiwrapper/AxisWrapper.hxx
+++ b/chart2/source/controller/chartapiwrapper/AxisWrapper.hxx
@@ -23,7 +23,7 @@
 #include "ReferenceSizePropertyProvider.hxx"
 #include <cppuhelper/implbase.hxx>
 #include <comphelper/uno3.hxx>
-#include <cppuhelper/interfacecontainer.hxx>
+#include <comphelper/interfacecontainer2.hxx>
 #include <com/sun/star/chart/XAxis.hpp>
 #include <com/sun/star/chart2/XAxis.hpp>
 #include <com/sun/star/frame/XModel.hpp>
@@ -131,7 +131,7 @@ private: //methods
 
 private: //member
     std::shared_ptr< Chart2ModelContact >   m_spChart2ModelContact;
-    ::cppu::OInterfaceContainerHelper           m_aEventListenerContainer;
+    ::comphelper::OInterfaceContainerHelper2      m_aEventListenerContainer;
 
     tAxisType           m_eType;
 
diff --git a/chart2/source/controller/chartapiwrapper/ChartDataWrapper.cxx b/chart2/source/controller/chartapiwrapper/ChartDataWrapper.cxx
index 8c850b7..dfde917 100644
--- a/chart2/source/controller/chartapiwrapper/ChartDataWrapper.cxx
+++ b/chart2/source/controller/chartapiwrapper/ChartDataWrapper.cxx
@@ -607,16 +607,7 @@ void ChartDataWrapper::fireChartDataChangeEvent(
     if( xSrc.is() )
         aEvent.Source = xSrc;
 
-    ::cppu::OInterfaceIteratorHelper aIter( m_aEventListenerContainer );
-
-    while( aIter.hasMoreElements() )
-    {
-        uno::Reference<
-            ::com::sun::star::chart::XChartDataChangeEventListener > xListener(
-                aIter.next(), uno::UNO_QUERY );
-        if( xListener.is() )
-            xListener->chartDataChanged( aEvent );
-    }
+    m_aEventListenerContainer.notifyEach( &css::chart::XChartDataChangeEventListener::chartDataChanged, aEvent );
 }
 
 void ChartDataWrapper::switchToInternalDataProvider()
diff --git a/chart2/source/controller/chartapiwrapper/ChartDataWrapper.hxx b/chart2/source/controller/chartapiwrapper/ChartDataWrapper.hxx
index d5ab6d0..0f2f2f9 100644
--- a/chart2/source/controller/chartapiwrapper/ChartDataWrapper.hxx
+++ b/chart2/source/controller/chartapiwrapper/ChartDataWrapper.hxx
@@ -21,7 +21,7 @@
 
 #include "MutexContainer.hxx"
 #include <cppuhelper/implbase.hxx>
-#include <cppuhelper/interfacecontainer.hxx>
+#include <comphelper/interfacecontainer2.hxx>
 #include <com/sun/star/chart2/XAnyDescriptionAccess.hpp>
 #include <com/sun/star/chart/XDateCategories.hpp>
 #include <com/sun/star/lang/XComponent.hpp>
@@ -157,7 +157,7 @@ private: //member
         ::com::sun::star::chart2::XAnyDescriptionAccess > m_xDataAccess;
 
     std::shared_ptr< Chart2ModelContact >   m_spChart2ModelContact;
-    ::cppu::OInterfaceContainerHelper           m_aEventListenerContainer;
+    ::comphelper::OInterfaceContainerHelper2      m_aEventListenerContainer;
 };
 
 } //  namespace wrapper
diff --git a/chart2/source/controller/chartapiwrapper/DataSeriesPointWrapper.hxx b/chart2/source/controller/chartapiwrapper/DataSeriesPointWrapper.hxx
index b95d585..da6455a 100644
--- a/chart2/source/controller/chartapiwrapper/DataSeriesPointWrapper.hxx
+++ b/chart2/source/controller/chartapiwrapper/DataSeriesPointWrapper.hxx
@@ -23,7 +23,7 @@
 #include "ReferenceSizePropertyProvider.hxx"
 #include <cppuhelper/implbase.hxx>
 #include <comphelper/uno3.hxx>
-#include <cppuhelper/interfacecontainer.hxx>
+#include <comphelper/interfacecontainer2.hxx>
 #include <com/sun/star/chart2/XDataSeries.hpp>
 #include <com/sun/star/frame/XModel.hpp>
 #include <com/sun/star/lang/XComponent.hpp>
@@ -126,7 +126,7 @@ protected:
 
 private:
     std::shared_ptr< Chart2ModelContact >   m_spChart2ModelContact;
-    ::cppu::OInterfaceContainerHelper           m_aEventListenerContainer;
+    ::comphelper::OInterfaceContainerHelper2      m_aEventListenerContainer;
 
     eType               m_eType;
     sal_Int32           m_nSeriesIndexInNewAPI;
diff --git a/chart2/source/controller/chartapiwrapper/DiagramWrapper.hxx b/chart2/source/controller/chartapiwrapper/DiagramWrapper.hxx
index bc2b0f3..0ec3eb5 100644
--- a/chart2/source/controller/chartapiwrapper/DiagramWrapper.hxx
+++ b/chart2/source/controller/chartapiwrapper/DiagramWrapper.hxx
@@ -241,7 +241,7 @@ protected:
 
 private:
     std::shared_ptr< Chart2ModelContact >   m_spChart2ModelContact;
-    ::cppu::OInterfaceContainerHelper           m_aEventListenerContainer;
+    ::comphelper::OInterfaceContainerHelper2           m_aEventListenerContainer;
 
     ::com::sun::star::uno::Reference<
         ::com::sun::star::chart::XAxis >        m_xXAxis;
diff --git a/chart2/source/controller/chartapiwrapper/GridWrapper.hxx b/chart2/source/controller/chartapiwrapper/GridWrapper.hxx
index 590c232..a53e0b0 100644
--- a/chart2/source/controller/chartapiwrapper/GridWrapper.hxx
+++ b/chart2/source/controller/chartapiwrapper/GridWrapper.hxx
@@ -22,7 +22,7 @@
 #include "WrappedPropertySet.hxx"
 #include <cppuhelper/implbase.hxx>
 #include <comphelper/uno3.hxx>
-#include <cppuhelper/interfacecontainer.hxx>
+#include <comphelper/interfacecontainer2.hxx>
 #include <com/sun/star/drawing/XShape.hpp>
 #include <com/sun/star/lang/XComponent.hpp>
 #include <com/sun/star/lang/XServiceInfo.hpp>
@@ -89,7 +89,7 @@ protected:
 
 private:
     std::shared_ptr< Chart2ModelContact >   m_spChart2ModelContact;
-    ::cppu::OInterfaceContainerHelper           m_aEventListenerContainer;
+    ::comphelper::OInterfaceContainerHelper2      m_aEventListenerContainer;
 
     tGridType           m_eType;
 };
diff --git a/chart2/source/controller/chartapiwrapper/LegendWrapper.hxx b/chart2/source/controller/chartapiwrapper/LegendWrapper.hxx
index 2d6ea1c..8b1f1c2 100644
--- a/chart2/source/controller/chartapiwrapper/LegendWrapper.hxx
+++ b/chart2/source/controller/chartapiwrapper/LegendWrapper.hxx
@@ -23,7 +23,7 @@
 #include "ReferenceSizePropertyProvider.hxx"
 #include <cppuhelper/implbase.hxx>
 #include <comphelper/uno3.hxx>
-#include <cppuhelper/interfacecontainer.hxx>
+#include <comphelper/interfacecontainer2.hxx>
 #include <com/sun/star/drawing/XShape.hpp>
 #include <com/sun/star/lang/XComponent.hpp>
 #include <com/sun/star/lang/XServiceInfo.hpp>
@@ -102,7 +102,7 @@ protected:
 
 private:
     std::shared_ptr< Chart2ModelContact >   m_spChart2ModelContact;
-    ::cppu::OInterfaceContainerHelper           m_aEventListenerContainer;
+    ::comphelper::OInterfaceContainerHelper2      m_aEventListenerContainer;
 };
 
 } //  namespace wrapper
diff --git a/chart2/source/controller/chartapiwrapper/MinMaxLineWrapper.hxx b/chart2/source/controller/chartapiwrapper/MinMaxLineWrapper.hxx
index e779fde..08748bf 100644
--- a/chart2/source/controller/chartapiwrapper/MinMaxLineWrapper.hxx
+++ b/chart2/source/controller/chartapiwrapper/MinMaxLineWrapper.hxx
@@ -21,7 +21,7 @@
 
 #include "MutexContainer.hxx"
 #include "WrappedIgnoreProperty.hxx"
-#include <cppuhelper/interfacecontainer.hxx>
+#include <comphelper/interfacecontainer2.hxx>
 
 #include <com/sun/star/chart2/XDiagram.hpp>
 
@@ -115,7 +115,7 @@ private: //methods
 
 private: //member
     std::shared_ptr< Chart2ModelContact >   m_spChart2ModelContact;
-    ::cppu::OInterfaceContainerHelper           m_aEventListenerContainer;
+    ::comphelper::OInterfaceContainerHelper2      m_aEventListenerContainer;
 
     WrappedIgnoreProperty               m_aWrappedLineJointProperty;
 };
diff --git a/chart2/source/controller/chartapiwrapper/TitleWrapper.hxx b/chart2/source/controller/chartapiwrapper/TitleWrapper.hxx
index 9bb457b..648281f 100644
--- a/chart2/source/controller/chartapiwrapper/TitleWrapper.hxx
+++ b/chart2/source/controller/chartapiwrapper/TitleWrapper.hxx
@@ -123,7 +123,7 @@ private:
 
 private:
     std::shared_ptr< Chart2ModelContact >   m_spChart2ModelContact;
-    ::cppu::OInterfaceContainerHelper           m_aEventListenerContainer;
+    ::comphelper::OInterfaceContainerHelper2           m_aEventListenerContainer;
 
     ::chart::TitleHelper::eTitleType        m_eTitleType;
 };
diff --git a/chart2/source/controller/chartapiwrapper/UpDownBarWrapper.hxx b/chart2/source/controller/chartapiwrapper/UpDownBarWrapper.hxx
index ae6f08f..938fe08 100644
--- a/chart2/source/controller/chartapiwrapper/UpDownBarWrapper.hxx
+++ b/chart2/source/controller/chartapiwrapper/UpDownBarWrapper.hxx
@@ -20,7 +20,7 @@
 #define INCLUDED_CHART2_SOURCE_CONTROLLER_CHARTAPIWRAPPER_UPDOWNBARWRAPPER_HXX
 
 #include "MutexContainer.hxx"
-#include <cppuhelper/interfacecontainer.hxx>
+#include <comphelper/interfacecontainer2.hxx>
 
 #include <com/sun/star/chart2/XDiagram.hpp>
 
@@ -114,7 +114,7 @@ private: //methods
 
 private: //member
     std::shared_ptr< Chart2ModelContact >   m_spChart2ModelContact;
-    ::cppu::OInterfaceContainerHelper           m_aEventListenerContainer;
+    ::comphelper::OInterfaceContainerHelper2      m_aEventListenerContainer;
 
     OUString       m_aPropertySetName;
 };
diff --git a/chart2/source/controller/chartapiwrapper/WallFloorWrapper.hxx b/chart2/source/controller/chartapiwrapper/WallFloorWrapper.hxx
index f9e5429..3773f1f 100644
--- a/chart2/source/controller/chartapiwrapper/WallFloorWrapper.hxx
+++ b/chart2/source/controller/chartapiwrapper/WallFloorWrapper.hxx
@@ -22,7 +22,7 @@
 #include "WrappedPropertySet.hxx"
 #include <cppuhelper/implbase.hxx>
 #include <comphelper/uno3.hxx>
-#include <cppuhelper/interfacecontainer.hxx>
+#include <comphelper/interfacecontainer2.hxx>
 #include <com/sun/star/lang/XComponent.hpp>
 #include <com/sun/star/lang/XServiceInfo.hpp>
 #include <com/sun/star/uno/XComponentContext.hpp>
@@ -76,7 +76,7 @@ protected:
 
 private:
     std::shared_ptr< Chart2ModelContact >   m_spChart2ModelContact;
-    ::cppu::OInterfaceContainerHelper           m_aEventListenerContainer;
+    ::comphelper::OInterfaceContainerHelper2      m_aEventListenerContainer;
 
     bool m_bWall;
 };
diff --git a/chart2/source/controller/main/CommandDispatch.cxx b/chart2/source/controller/main/CommandDispatch.cxx
index 35cbf08..ea7fd7a 100644
--- a/chart2/source/controller/main/CommandDispatch.cxx
+++ b/chart2/source/controller/main/CommandDispatch.cxx
@@ -86,7 +86,7 @@ void SAL_CALL CommandDispatch::addStatusListener( const Reference< frame::XStatu
     {
         aIt = m_aListeners.insert(
             m_aListeners.begin(),
-            tListenerMap::value_type( URL.Complete, new ::cppu::OInterfaceContainerHelper( m_aMutex )));
+            tListenerMap::value_type( URL.Complete, new ::comphelper::OInterfaceContainerHelper2( m_aMutex )));
     }
     OSL_ASSERT( aIt != m_aListeners.end());
 
@@ -155,7 +155,7 @@ void CommandDispatch::fireStatusEventForURL(
         {
             if( aIt->second )
             {
-                ::cppu::OInterfaceIteratorHelper aIntfIt( *((*aIt).second) );
+                ::comphelper::OInterfaceIteratorHelper2 aIntfIt( *((*aIt).second) );
 
                 while( aIntfIt.hasMoreElements())
                 {
diff --git a/chart2/source/controller/main/CommandDispatch.hxx b/chart2/source/controller/main/CommandDispatch.hxx
index 6d9feb0..9286915 100644
--- a/chart2/source/controller/main/CommandDispatch.hxx
+++ b/chart2/source/controller/main/CommandDispatch.hxx
@@ -21,6 +21,7 @@
 
 #include "MutexContainer.hxx"
 #include <cppuhelper/compbase.hxx>
+#include <comphelper/interfacecontainer2.hxx>
 #include <com/sun/star/frame/XDispatch.hpp>
 #include <com/sun/star/util/XModifyListener.hpp>
 #include <com/sun/star/uno/XComponentContext.hpp>
@@ -130,7 +131,7 @@ protected:
     ::com::sun::star::uno::Reference< ::com::sun::star::util::XURLTransformer >  m_xURLTransformer;
 
 private:
-    typedef ::std::map< OUString, ::cppu::OInterfaceContainerHelper* >
+    typedef ::std::map< OUString, ::comphelper::OInterfaceContainerHelper2* >
         tListenerMap;
 
     tListenerMap m_aListeners;
diff --git a/chart2/source/model/main/ChartModel.cxx b/chart2/source/model/main/ChartModel.cxx
index 3f7c8f3..0b88e75 100644
--- a/chart2/source/model/main/ChartModel.cxx
+++ b/chart2/source/model/main/ChartModel.cxx
@@ -227,10 +227,10 @@ bool ChartModel::impl_isControllerConnected( const uno::Reference< frame::XContr
 {
     try
     {
-        uno::Sequence< uno::Reference<uno::XInterface> > aSeq = m_aControllers.getElements();
-        for( sal_Int32 nN = aSeq.getLength(); nN--; )
+        std::vector< uno::Reference<uno::XInterface> > aSeq = m_aControllers.getElements();
+        for( const auto & r : aSeq )
         {
-            if( aSeq[nN] == xController )
+            if( r == xController )
                 return true;
         }
     }
diff --git a/comphelper/CppunitTest_comphelper_ifcontainer.mk b/comphelper/CppunitTest_comphelper_ifcontainer.mk
new file mode 100644
index 0000000..d336c55
--- /dev/null
+++ b/comphelper/CppunitTest_comphelper_ifcontainer.mk
@@ -0,0 +1,29 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+#
+# 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/.
+#
+
+$(eval $(call gb_CppunitTest_CppunitTest,comphelper_ifcontainer))
+
+$(eval $(call gb_CppunitTest_add_exception_objects,comphelper_ifcontainer,\
+    comphelper/qa/container/comphelper_ifcontainer \
+))
+
+$(eval $(call gb_CppunitTest_use_api,comphelper_ifcontainer,\
+	udkapi \
+))
+
+$(eval $(call gb_CppunitTest_use_libraries,comphelper_ifcontainer,\
+    comphelper \
+	cppu \
+    cppuhelper \
+	sal \
+	$(gb_UWINAPI) \
+))
+
+# vim: set noet sw=4 ts=4:
diff --git a/comphelper/CppunitTest_comphelper_test.mk b/comphelper/CppunitTest_comphelper_test.mk
index 89e0710..47843c6 100644
--- a/comphelper/CppunitTest_comphelper_test.mk
+++ b/comphelper/CppunitTest_comphelper_test.mk
@@ -11,6 +11,7 @@ $(eval $(call gb_CppunitTest_CppunitTest,comphelper_test))
 
 $(eval $(call gb_CppunitTest_add_exception_objects,comphelper_test, \
     comphelper/qa/string/test_string \
+    comphelper/qa/container/testifcontainer \
 ))
 
 $(eval $(call gb_CppunitTest_use_api,comphelper_test, \
diff --git a/comphelper/Library_comphelper.mk b/comphelper/Library_comphelper.mk
index 6f2cc4c..155d293 100644
--- a/comphelper/Library_comphelper.mk
+++ b/comphelper/Library_comphelper.mk
@@ -60,6 +60,7 @@ $(eval $(call gb_Library_add_exception_objects,comphelper,\
     comphelper/source/container/NamedPropertyValuesContainer \
     comphelper/source/container/container \
     comphelper/source/container/containermultiplexer \
+	comphelper/source/container/interfacecontainer2 \
     comphelper/source/container/embeddedobjectcontainer \
     comphelper/source/container/enumerablemap \
     comphelper/source/container/enumhelper \
diff --git a/comphelper/Module_comphelper.mk b/comphelper/Module_comphelper.mk
index acd50c6..2eba43d 100644
--- a/comphelper/Module_comphelper.mk
+++ b/comphelper/Module_comphelper.mk
@@ -30,6 +30,7 @@ $(eval $(call gb_Module_add_subsequentcheck_targets,comphelper,\
 $(eval $(call gb_Module_add_check_targets,comphelper,\
     CppunitTest_comphelper_syntaxhighlight_test \
     CppunitTest_comphelper_variadictemplates_test \
+	CppunitTest_comphelper_ifcontainer \
     CppunitTest_comphelper_test \
 ))
 
diff --git a/comphelper/qa/container/comphelper_ifcontainer.cxx b/comphelper/qa/container/comphelper_ifcontainer.cxx
new file mode 100644
index 0000000..ba9af49
--- /dev/null
+++ b/comphelper/qa/container/comphelper_ifcontainer.cxx
@@ -0,0 +1,212 @@
+/* -*- 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 .
+ */
+
+#include <sal/types.h>
+
+#include <string.h>
+#include <cppunit/TestFixture.h>
+#include <cppunit/extensions/HelperMacros.h>
+#include <cppunit/plugin/TestPlugIn.h>
+
+#include <com/sun/star/lang/XEventListener.hpp>
+#include <comphelper/interfacecontainer2.hxx>
+#include <cppuhelper/queryinterface.hxx>
+#include <cppuhelper/implbase1.hxx>
+#include <cppuhelper/propshlp.hxx>
+
+using namespace com::sun::star;
+using namespace com::sun::star::uno;
+using namespace com::sun::star::lang;
+
+class ContainerListener;
+
+struct ContainerStats {
+    int m_nAlive;
+    int m_nDisposed;
+    ContainerStats() : m_nAlive(0), m_nDisposed(0) {}
+};
+
+class ContainerListener : public ::cppu::WeakImplHelper1< XEventListener >
+{
+    ContainerStats *m_pStats;
+public:
+    explicit ContainerListener(ContainerStats *pStats)
+        : m_pStats(pStats) { m_pStats->m_nAlive++; }
+    virtual ~ContainerListener() { m_pStats->m_nAlive--; }
+    virtual void SAL_CALL disposing( const EventObject& )
+        throw (RuntimeException, std::exception) override
+    {
+        m_pStats->m_nDisposed++;
+    }
+};
+
+namespace comphelper_ifcontainer
+{
+    static const int nTests = 10;
+    class IfTest : public CppUnit::TestFixture
+    {
+        osl::Mutex m_aGuard;
+    public:
+        void testCreateDispose()
+        {
+            ContainerStats aStats;
+            comphelper::OInterfaceContainerHelper2 *pContainer;
+
+            pContainer = new comphelper::OInterfaceContainerHelper2(m_aGuard);
+
+            CPPUNIT_ASSERT_MESSAGE("Empty container not empty",
+                                   pContainer->getLength() == 0);
+
+            int i;
+            for (i = 0; i < nTests; i++)
+            {
+                Reference<XEventListener> xRef = new ContainerListener(&aStats);
+                int nNewLen = pContainer->addInterface(xRef);
+
+                CPPUNIT_ASSERT_MESSAGE("addition length mismatch",
+                                       nNewLen == i + 1);
+                CPPUNIT_ASSERT_MESSAGE("addition length mismatch",
+                                       pContainer->getLength() == i + 1);
+            }
+            CPPUNIT_ASSERT_MESSAGE("alive count mismatch",
+                                   aStats.m_nAlive == nTests);
+
+            EventObject aObj;
+            pContainer->disposeAndClear(aObj);
+
+            CPPUNIT_ASSERT_MESSAGE("dispose count mismatch",
+                                   aStats.m_nDisposed == nTests);
+            CPPUNIT_ASSERT_MESSAGE("leaked container left alive",
+                                   aStats.m_nAlive == 0);
+
+            delete pContainer;
+        }
+
+        void testEnumerate()
+        {
+            int i;
+            ContainerStats aStats;
+            comphelper::OInterfaceContainerHelper2 *pContainer;
+            pContainer = new comphelper::OInterfaceContainerHelper2(m_aGuard);
+
+            std::vector< Reference< XEventListener > > aListeners;
+            for (i = 0; i < nTests; i++)
+            {
+                Reference<XEventListener> xRef = new ContainerListener(&aStats);
+                pContainer->addInterface(xRef);
+                aListeners.push_back(xRef);
+            }
+            std::vector< Reference< XInterface > > aElements = pContainer->getElements();
+
+            CPPUNIT_ASSERT_EQUAL_MESSAGE("query contents",
+                                   (int)aElements.size(), nTests);
+            if ((int)aElements.size() == nTests)
+            {
+                for (i = 0; i < nTests; i++)
+                {
+                    CPPUNIT_ASSERT_MESSAGE("mismatching elements",
+                                           aElements[i] == aListeners[i]);
+                }
+            }
+            pContainer->clear();
+
+            CPPUNIT_ASSERT_MESSAGE("non-empty container post clear",
+                                   pContainer->getLength() == 0);
+            delete pContainer;
+        }
+
+        template < typename ContainerType, typename ContainedType >
+        void doContainerTest(const ContainedType *pTypes)
+        {
+            ContainerStats aStats;
+            ContainerType *pContainer;
+            pContainer = new ContainerType(m_aGuard);
+
+            int i;
+            Reference<XEventListener> xRefs[nTests * 2];
+
+            // add these interfaces
+            for (i = 0; i < nTests * 2; i++)
+            {
+                xRefs[i] = new ContainerListener(&aStats);
+                pContainer->addInterface(pTypes[i / 2], xRefs[i]);
+            }
+
+            // check it is all there
+            for (i = 0; i < nTests; i++)
+            {
+                cppu::OInterfaceContainerHelper *pHelper;
+
+                pHelper = pContainer->getContainer(pTypes[i]);
+
+                CPPUNIT_ASSERT_MESSAGE("no helper", pHelper != nullptr);
+                Sequence<Reference< XInterface > > aSeq = pHelper->getElements();
+                CPPUNIT_ASSERT_MESSAGE("wrong num elements", aSeq.getLength() == 2);
+                CPPUNIT_ASSERT_MESSAGE("match", aSeq[0] == xRefs[i*2]);
+                CPPUNIT_ASSERT_MESSAGE("match", aSeq[1] == xRefs[i*2+1]);
+            }
+
+            // remove every other interface
+            for (i = 0; i < nTests; i++)
+                pContainer->removeInterface(pTypes[i], xRefs[i*2+1]);
+
+            // check it is half there
+            for (i = 0; i < nTests; i++)
+            {
+                cppu::OInterfaceContainerHelper *pHelper;
+
+                pHelper = pContainer->getContainer(pTypes[i]);
+
+                CPPUNIT_ASSERT_MESSAGE("no helper", pHelper != nullptr);
+                Sequence<Reference< XInterface > > aSeq = pHelper->getElements();
+                CPPUNIT_ASSERT_MESSAGE("wrong num elements", aSeq.getLength() == 1);
+                CPPUNIT_ASSERT_MESSAGE("match", aSeq[0] == xRefs[i*2]);
+            }
+
+            // remove the 1st half of the rest
+            for (i = 0; i < nTests / 2; i++)
+                pContainer->removeInterface(pTypes[i], xRefs[i*2]);
+
+            // check it is half there
+            for (i = 0; i < nTests / 2; i++)
+            {
+                cppu::OInterfaceContainerHelper *pHelper;
+
+                pHelper = pContainer->getContainer(pTypes[i]);
+                CPPUNIT_ASSERT_MESSAGE("no helper", pHelper != nullptr);
+                Sequence<Reference< XInterface > > aSeq = pHelper->getElements();
+                CPPUNIT_ASSERT_MESSAGE("wrong num elements", aSeq.getLength() == 0);
+            }
+
+            delete pContainer;
+        }
+
+        // Automatic registration code
+        CPPUNIT_TEST_SUITE(IfTest);
+        CPPUNIT_TEST(testCreateDispose);
+        CPPUNIT_TEST(testEnumerate);
+        CPPUNIT_TEST_SUITE_END();
+    };
+} // namespace cppu_ifcontainer
+
+CPPUNIT_TEST_SUITE_REGISTRATION(comphelper_ifcontainer::IfTest);
+
+CPPUNIT_PLUGIN_IMPLEMENT();
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/comphelper/qa/container/testifcontainer.cxx b/comphelper/qa/container/testifcontainer.cxx
new file mode 100644
index 0000000..7533695
--- /dev/null
+++ b/comphelper/qa/container/testifcontainer.cxx
@@ -0,0 +1,145 @@
+/* -*- 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 .
+ */
+
+#include <osl/mutex.hxx>
+
+#include <cppuhelper/interfacecontainer.hxx>
+#include <cppuhelper/implbase1.hxx>
+
+#include <com/sun/star/beans/XVetoableChangeListener.hpp>
+
+using namespace ::cppu;
+using namespace ::osl;
+using namespace ::com::sun::star::lang;
+using namespace ::com::sun::star::beans;
+using namespace ::com::sun::star::uno;
+
+
+class TestListener : public WeakImplHelper1< XVetoableChangeListener >
+{
+public:
+    // Methods
+    virtual void SAL_CALL disposing( const css::lang::EventObject& /*Source*/ ) throw(css::uno::RuntimeException)
+        {
+
+        }
+
+    virtual void SAL_CALL vetoableChange( const css::beans::PropertyChangeEvent& /*aEvent*/ )
+       throw(css::beans::PropertyVetoException, css::uno::RuntimeException)
+        {
+
+        }
+};
+
+void test_interfacecontainer()
+{
+    Mutex mutex;
+
+    {
+        OInterfaceContainerHelper helper( mutex );
+
+        Reference< XVetoableChangeListener > r1 = new TestListener();
+        Reference< XVetoableChangeListener > r2 = new TestListener();
+        Reference< XVetoableChangeListener > r3 = new TestListener();
+
+        helper.addInterface( r1 );
+        helper.addInterface( r2 );
+        helper.addInterface( r3 );
+
+        helper.disposeAndClear( EventObject() );
+    }
+
+    {
+        OInterfaceContainerHelper helper( mutex );
+
+        Reference< XVetoableChangeListener > r1 = new TestListener();
+        Reference< XVetoableChangeListener > r2 = new TestListener();
+        Reference< XVetoableChangeListener > r3 = new TestListener();
+
+        helper.addInterface( r1 );
+        helper.addInterface( r2 );
+        helper.addInterface( r3 );
+
+        OInterfaceIteratorHelper iterator( helper );
+
+        while( iterator.hasMoreElements() )
+            ((XVetoableChangeListener*)iterator.next())->vetoableChange( PropertyChangeEvent() );
+
+        helper.disposeAndClear( EventObject() );
+    }
+
+    {
+        OInterfaceContainerHelper helper( mutex );
+
+        Reference< XVetoableChangeListener > r1 = new TestListener();
+        Reference< XVetoableChangeListener > r2 = new TestListener();
+        Reference< XVetoableChangeListener > r3 = new TestListener();
+
+        helper.addInterface( r1 );
+        helper.addInterface( r2 );
+        helper.addInterface( r3 );
+
+        OInterfaceIteratorHelper iterator( helper );
+
+        ((XVetoableChangeListener*)iterator.next())->vetoableChange( PropertyChangeEvent() );
+        iterator.remove();
+        ((XVetoableChangeListener*)iterator.next())->vetoableChange( PropertyChangeEvent() );
+        iterator.remove();
+        ((XVetoableChangeListener*)iterator.next())->vetoableChange( PropertyChangeEvent() );
+        iterator.remove();
+
+        OSL_ASSERT( helper.getLength() == 0 );
+        helper.disposeAndClear( EventObject() );
+    }
+
+    {
+        OInterfaceContainerHelper helper( mutex );
+
+        Reference< XVetoableChangeListener > r1 = new TestListener();
+        Reference< XVetoableChangeListener > r2 = new TestListener();
+        Reference< XVetoableChangeListener > r3 = new TestListener();
+
+        helper.addInterface( r1 );
+        helper.addInterface( r2 );
+        helper.addInterface( r3 );
+
+        {
+            OInterfaceIteratorHelper iterator( helper );
+            while( iterator.hasMoreElements() )
+            {
+                Reference< XVetoableChangeListener > r = ((XVetoableChangeListener*)iterator.next());
+                if( r == r1 )
+                    iterator.remove();
+            }
+        }
+        OSL_ASSERT( helper.getLength() == 2 );
+        {
+            OInterfaceIteratorHelper iterator( helper );
+            while( iterator.hasMoreElements() )
+            {
+                Reference< XVetoableChangeListener > r = ((XVetoableChangeListener*)iterator.next());
+                OSL_ASSERT( r != r1 && ( r == r2 || r == r3 ) );
+            }
+        }
+
+        helper.disposeAndClear( EventObject() );
+    }
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/comphelper/source/container/interfacecontainer2.cxx b/comphelper/source/container/interfacecontainer2.cxx
new file mode 100644
index 0000000..90f4e01
--- /dev/null
+++ b/comphelper/source/container/interfacecontainer2.cxx
@@ -0,0 +1,307 @@
+/* -*- 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 .
+ */
+
+
+#include <cppuhelper/interfacecontainer.hxx>
+#include <comphelper/interfacecontainer2.hxx>
+#include <cppuhelper/queryinterface.hxx>
+#include <cppuhelper/propshlp.hxx>
+
+#include <osl/diagnose.h>
+#include <osl/mutex.hxx>
+
+#include <memory>
+
+#include <com/sun/star/lang/XEventListener.hpp>
+
+
+using namespace osl;
+using namespace com::sun::star::uno;
+using namespace com::sun::star::lang;
+
+namespace comphelper
+{
+
+OInterfaceIteratorHelper2::OInterfaceIteratorHelper2( OInterfaceContainerHelper2 & rCont_ )
+    : rCont( rCont_ )
+{
+    MutexGuard aGuard( rCont.rMutex );
+    if( rCont.bInUse )
+        // worst case, two iterators at the same time
+        rCont.copyAndResetInUse();
+    bIsList = rCont_.bIsList;
+    aData = rCont_.aData;
+    if( bIsList )
+    {
+        rCont.bInUse = true;
+        nRemain = aData.pAsVector->size();
+    }
+    else if( aData.pAsInterface )
+    {
+        aData.pAsInterface->acquire();
+        nRemain = 1;
+    }
+    else
+        nRemain = 0;
+}
+
+OInterfaceIteratorHelper2::~OInterfaceIteratorHelper2()
+{
+    bool bShared;
+    {
+    MutexGuard aGuard( rCont.rMutex );
+    // bResetInUse protect the iterator against recursion
+    bShared = aData.pAsVector == rCont.aData.pAsVector && rCont.bIsList;
+    if( bShared )
+    {
+        OSL_ENSURE( rCont.bInUse, "OInterfaceContainerHelper2 must be in use" );
+        rCont.bInUse = false;
+    }
+    }
+
+    if( !bShared )
+    {
+        if( bIsList )
+            // Sequence owned by the iterator
+            delete aData.pAsVector;
+        else if( aData.pAsInterface )
+            // Interface is acquired by the iterator
+            aData.pAsInterface->release();
+    }
+}
+
+XInterface * OInterfaceIteratorHelper2::next()
+{
+    if( nRemain )
+    {
+        nRemain--;
+        if( bIsList )
+            return (*aData.pAsVector)[nRemain].get();
+        else if( aData.pAsInterface )
+            return aData.pAsInterface;
+    }
+    // exception
+    return nullptr;
+}
+
+void OInterfaceIteratorHelper2::remove()
+{
+    if( bIsList )
+    {
+        OSL_ASSERT( nRemain >= 0 &&
+                    nRemain < (sal_Int32)aData.pAsVector->size() );
+        rCont.removeInterface(  (*aData.pAsVector)[nRemain] );
+    }
+    else
+    {
+        OSL_ASSERT( 0 == nRemain );
+        rCont.removeInterface( aData.pAsInterface );
+    }
+}
+
+OInterfaceContainerHelper2::OInterfaceContainerHelper2( Mutex & rMutex_ )
+    : rMutex( rMutex_ )
+    , bInUse( false )
+    , bIsList( false )
+{
+}
+
+OInterfaceContainerHelper2::~OInterfaceContainerHelper2()
+{
+    OSL_ENSURE( !bInUse, "~OInterfaceContainerHelper2 but is in use" );
+    if( bIsList )
+        delete aData.pAsVector;
+    else if( aData.pAsInterface )
+        aData.pAsInterface->release();
+}
+
+sal_Int32 OInterfaceContainerHelper2::getLength() const
+{
+    MutexGuard aGuard( rMutex );
+    if( bIsList )
+        return aData.pAsVector->size();
+    else if( aData.pAsInterface )
+        return 1;
+    return 0;
+}
+
+std::vector< Reference<XInterface> > OInterfaceContainerHelper2::getElements() const
+{
+    std::vector< Reference<XInterface> > rVec;
+    MutexGuard aGuard( rMutex );
+    if( bIsList )
+        rVec = *aData.pAsVector;
+    else if( aData.pAsInterface )
+    {
+        rVec.push_back( Reference<XInterface>( aData.pAsInterface ) );
+    }
+    return rVec;
+}
+
+void OInterfaceContainerHelper2::copyAndResetInUse()
+{
+    OSL_ENSURE( bInUse, "OInterfaceContainerHelper2 not in use" );
+    if( bInUse )
+    {
+        // this should be the worst case. If a iterator is active
+        // and a new Listener is added.
+        if( bIsList )
+            aData.pAsVector = new std::vector< Reference< XInterface > >( *aData.pAsVector );
+        else if( aData.pAsInterface )
+            aData.pAsInterface->acquire();
+
+        bInUse = false;
+    }
+}
+
+sal_Int32 OInterfaceContainerHelper2::addInterface( const Reference<XInterface> & rListener )
+{
+    OSL_ASSERT( rListener.is() );
+    MutexGuard aGuard( rMutex );
+    if( bInUse )
+        copyAndResetInUse();
+
+    if( bIsList )
+    {
+        aData.pAsVector->push_back(  rListener );
+        return aData.pAsVector->size();
+    }
+    else if( aData.pAsInterface )
+    {
+        std::vector< Reference< XInterface > > * pVec = new std::vector< Reference< XInterface > >( 2 );
+        (*pVec)[0] = aData.pAsInterface;
+        (*pVec)[1] = rListener;
+        aData.pAsInterface->release();
+        aData.pAsVector = pVec;
+        bIsList = true;
+        return 2;
+    }
+    else
+    {
+        aData.pAsInterface = rListener.get();
+        if( rListener.is() )
+            rListener->acquire();
+        return 1;
+    }
+}
+
+sal_Int32 OInterfaceContainerHelper2::removeInterface( const Reference<XInterface> & rListener )
+{
+    OSL_ASSERT( rListener.is() );
+    MutexGuard aGuard( rMutex );
+    if( bInUse )
+        copyAndResetInUse();
+
+    if( bIsList )
+    {
+        sal_Int32 nLen = aData.pAsVector->size();
+        sal_Int32 i;
+        for( i = 0; i < nLen; i++ )
+        {
+            // It is not valid to compare the pointer directly, but it's faster.
+            if( (*aData.pAsVector)[i].get() == rListener.get() )
+            {
+                aData.pAsVector->erase(aData.pAsVector->begin()+i);
+                break;
+            }
+        }
+
+        // interface not found, use the correct compare method
+        if( i == nLen )
+        {
+            for( i = 0; i < nLen; i++ )
+            {
+                if( (*aData.pAsVector)[i] == rListener )
+                {
+                    aData.pAsVector->erase(aData.pAsVector->begin()+i);
+                    break;
+                }
+            }
+        }
+
+        if( aData.pAsVector->size() == 1 )
+        {
+            XInterface * p = (*aData.pAsVector)[0].get();
+            p->acquire();
+            delete aData.pAsVector;
+            aData.pAsInterface = p;
+            bIsList = false;
+            return 1;
+        }
+        else
+            return aData.pAsVector->size();
+    }
+    else if( aData.pAsInterface && Reference<XInterface>( aData.pAsInterface ) == rListener )
+    {
+        aData.pAsInterface->release();
+        aData.pAsInterface = nullptr;
+    }
+    return aData.pAsInterface ? 1 : 0;
+}
+
+void OInterfaceContainerHelper2::disposeAndClear( const EventObject & rEvt )
+{
+    ClearableMutexGuard aGuard( rMutex );
+    OInterfaceIteratorHelper2 aIt( *this );
+    // Release container, in case new entries come while disposing
+    OSL_ENSURE( !bIsList || bInUse, "OInterfaceContainerHelper2 not in use" );
+    if( !bIsList && aData.pAsInterface )
+        aData.pAsInterface->release();
+    // set the member to null, use the iterator to delete the values
+    aData.pAsInterface = nullptr;
+    bIsList = false;
+    bInUse = false;
+    aGuard.clear();
+    while( aIt.hasMoreElements() )
+    {
+        try
+        {
+            Reference<XEventListener > xLst( aIt.next(), UNO_QUERY );
+            if( xLst.is() )
+                xLst->disposing( rEvt );
+        }
+        catch ( RuntimeException & )
+        {
+            // be robust, if e.g. a remote bridge has disposed already.
+            // there is no way to delegate the error to the caller :o(.
+        }
+    }
+}
+
+
+void OInterfaceContainerHelper2::clear()
+{
+    ClearableMutexGuard aGuard( rMutex );
+    OInterfaceIteratorHelper2 aIt( *this );
+    // Release container, in case new entries come while disposing
+    OSL_ENSURE( !bIsList || bInUse, "OInterfaceContainerHelper2 not in use" );
+    if( !bIsList && aData.pAsInterface )
+        aData.pAsInterface->release();
+    // set the member to null, use the iterator to delete the values
+    aData.pAsInterface = nullptr;
+    bIsList = false;
+    bInUse = false;
+    // release mutex before aIt destructor call
+    aGuard.clear();
+}
+
+
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/comphelper/source/eventattachermgr/eventattachermgr.cxx b/comphelper/source/eventattachermgr/eventattachermgr.cxx
index 0717ea1..2f2fb5d 100644
--- a/comphelper/source/eventattachermgr/eventattachermgr.cxx
+++ b/comphelper/source/eventattachermgr/eventattachermgr.cxx
@@ -40,7 +40,7 @@
 #include <com/sun/star/script/XEventAttacherManager.hpp>
 #include <com/sun/star/script/XScriptListener.hpp>
 #include <cppuhelper/weak.hxx>
-#include <cppuhelper/interfacecontainer.hxx>
+#include <comphelper/interfacecontainer2.hxx>
 #include <cppuhelper/implbase.hxx>
 
 #include <deque>
@@ -82,7 +82,7 @@ class ImplEventAttacherManager
     ::std::deque< AttacherIndex_Impl >  aIndex;
     Mutex aLock;
     // Container for the ScriptListener
-    OInterfaceContainerHelper           aScriptListeners;
+    OInterfaceContainerHelper2          aScriptListeners;
     // Instance of EventAttacher
     Reference< XEventAttacher2 >        xAttacher;
     Reference< XComponentContext >      mxContext;
@@ -193,7 +193,7 @@ void SAL_CALL AttacherAllListener_Impl::firing(const AllEventObject& Event)
     aScriptEvent.ScriptCode     = aScriptCode;
 
     // Iterate over all listeners and pass events.
-    OInterfaceIteratorHelper aIt( mpManager->aScriptListeners );
+    OInterfaceIteratorHelper2 aIt( mpManager->aScriptListeners );
     while( aIt.hasMoreElements() )
         static_cast<XScriptListener *>(aIt.next())->firing( aScriptEvent );
 }
@@ -259,7 +259,7 @@ Any SAL_CALL AttacherAllListener_Impl::approveFiring( const AllEventObject& Even
 
     Any aRet;
     // Iterate over all listeners and pass events.
-    OInterfaceIteratorHelper aIt( mpManager->aScriptListeners );
+    OInterfaceIteratorHelper2 aIt( mpManager->aScriptListeners );
     while( aIt.hasMoreElements() )
     {
         aRet = static_cast<XScriptListener *>(aIt.next())->approveFiring( aScriptEvent );
diff --git a/comphelper/source/misc/accessibleeventnotifier.cxx b/comphelper/source/misc/accessibleeventnotifier.cxx
index 0d2cb84..348fb55 100644
--- a/comphelper/source/misc/accessibleeventnotifier.cxx
+++ b/comphelper/source/misc/accessibleeventnotifier.cxx
@@ -20,7 +20,7 @@
 #include <comphelper/accessibleeventnotifier.hxx>
 #include <osl/diagnose.h>
 #include <rtl/instance.hxx>
-#include <cppuhelper/interfacecontainer.h>
+#include <comphelper/interfacecontainer2.hxx>
 #include <comphelper/guarding.hxx>
 
 #include <map>
@@ -37,7 +37,7 @@ namespace
             AccessibleEventObject > ClientEvent;
 
     typedef ::std::map< AccessibleEventNotifier::TClientId,
-                ::cppu::OInterfaceContainerHelper*,
+                ::comphelper::OInterfaceContainerHelper2*,
                 ::std::less< AccessibleEventNotifier::TClientId > > ClientMap;
 
     /// key is the end of the interval, value is the start of the interval
@@ -153,8 +153,8 @@ namespace comphelper
         TClientId nNewClientId = generateId( );
 
         // the event listeners for the new client
-        ::cppu::OInterfaceContainerHelper *const pNewListeners =
-            new ::cppu::OInterfaceContainerHelper( lclMutex::get() );
+        ::comphelper::OInterfaceContainerHelper2 *const pNewListeners =
+            new ::comphelper::OInterfaceContainerHelper2( lclMutex::get() );
             // note that we're using our own mutex here, so the listener containers for all
             // our clients share this same mutex.
             // this is a reminiscence to the days where the notifier was asynchronous. Today this is
@@ -187,7 +187,7 @@ namespace comphelper
     void AccessibleEventNotifier::revokeClientNotifyDisposing( const TClientId _nClient,
             const Reference< XInterface >& _rxEventSource )
     {
-        ::cppu::OInterfaceContainerHelper* pListeners(nullptr);
+        ::comphelper::OInterfaceContainerHelper2* pListeners(nullptr);
 
         {
             // rhbz#1001768 drop the mutex before calling disposeAndClear
@@ -255,7 +255,7 @@ namespace comphelper
 
     void AccessibleEventNotifier::addEvent( const TClientId _nClient, const AccessibleEventObject& _rEvent )
     {
-        Sequence< Reference< XInterface > > aListeners;
+        std::vector< Reference< XInterface > > aListeners;
 
         // --- <mutex lock> -------------------------------
         {
@@ -272,20 +272,17 @@ namespace comphelper
         // --- </mutex lock> ------------------------------
 
             // default handling: loop through all listeners, and notify them
-        const Reference< XInterface >* pListeners = aListeners.getConstArray();
-        const Reference< XInterface >* pListenersEnd = pListeners + aListeners.getLength();
-        while ( pListeners != pListenersEnd )
+        for ( const auto& rListener : aListeners )
         {
             try
             {
-                static_cast< XAccessibleEventListener* >( pListeners->get() )->notifyEvent( _rEvent );
+                static_cast< XAccessibleEventListener* >( rListener.get() )->notifyEvent( _rEvent );
             }
             catch( const Exception& )
             {
                 // no assertion, because a broken access remote bridge or something like this
                 // can cause this exception
             }
-            ++pListeners;
         }
     }
 
diff --git a/comphelper/source/misc/instancelocker.cxx b/comphelper/source/misc/instancelocker.cxx
index 131efb7..01937dd 100644
--- a/comphelper/source/misc/instancelocker.cxx
+++ b/comphelper/source/misc/instancelocker.cxx
@@ -104,7 +104,7 @@ void SAL_CALL OInstanceLocker::addEventListener( const uno::Reference< lang::XEv
         throw lang::DisposedException(); // TODO
 
     if ( !m_pListenersContainer )
-        m_pListenersContainer = new ::cppu::OInterfaceContainerHelper( m_aMutex );
+        m_pListenersContainer = new ::comphelper::OInterfaceContainerHelper2( m_aMutex );
 
     m_pListenersContainer->addInterface( xListener );
 }
diff --git a/comphelper/source/misc/instancelocker.hxx b/comphelper/source/misc/instancelocker.hxx
index de9064d..3ac86e5 100644
--- a/comphelper/source/misc/instancelocker.hxx
+++ b/comphelper/source/misc/instancelocker.hxx
@@ -31,7 +31,7 @@
 #include <cppuhelper/weakref.hxx>
 #include <osl/mutex.hxx>
 #include <cppuhelper/implbase.hxx>
-#include <cppuhelper/interfacecontainer.h>
+#include <comphelper/interfacecontainer2.hxx>
 
 
 class OLockListener;
@@ -47,7 +47,7 @@ class OInstanceLocker : public ::cppu::WeakImplHelper< css::lang::XComponent,
     css::uno::Reference< css::uno::XInterface > m_xLockListener;
     OLockListener* m_pLockListener;
 
-    ::cppu::OInterfaceContainerHelper* m_pListenersContainer; // list of listeners
+    ::comphelper::OInterfaceContainerHelper2* m_pListenersContainer; // list of listeners
 
     bool m_bDisposed;
     bool m_bInitialized;
diff --git a/comphelper/source/misc/listenernotification.cxx b/comphelper/source/misc/listenernotification.cxx
index 7dc4332..5c0c56d 100644
--- a/comphelper/source/misc/listenernotification.cxx
+++ b/comphelper/source/misc/listenernotification.cxx
@@ -48,7 +48,7 @@ namespace comphelper
     void OListenerContainer::impl_removeListener( const Reference< XEventListener >& _rxListener )
     {
 #if OSL_DEBUG_LEVEL > 0
-        ::cppu::OInterfaceIteratorHelper aIter( m_aListeners );
+        ::comphelper::OInterfaceIteratorHelper2 aIter( m_aListeners );
         bool bFound = false;
         while ( aIter.hasMoreElements() && !bFound )
         {
@@ -74,7 +74,7 @@ namespace comphelper
 
     bool OListenerContainer::impl_notify( const EventObject& _rEvent )
     {
-        ::cppu::OInterfaceIteratorHelper aIter( m_aListeners );
+        ::comphelper::OInterfaceIteratorHelper2 aIter( m_aListeners );
         bool bCancelled = false;
         while ( aIter.hasMoreElements() && !bCancelled )
         {
diff --git a/comphelper/source/property/opropertybag.hxx b/comphelper/source/property/opropertybag.hxx
index a939ded..e2246f4 100644
--- a/comphelper/source/property/opropertybag.hxx
+++ b/comphelper/source/property/opropertybag.hxx
@@ -30,6 +30,7 @@
 
 #include <boost/noncopyable.hpp>
 #include <cppuhelper/implbase5.hxx>
+#include <comphelper/interfacecontainer2.hxx>
 #include <comphelper/propstate.hxx>
 #include <comphelper/broadcasthelper.hxx>
 #include <comphelper/propertybag.hxx>
@@ -84,7 +85,7 @@ namespace comphelper
         bool            m_bAutoAddProperties;
 
         /// for notification
-        ::cppu::OInterfaceContainerHelper m_NotifyListeners;
+        ::comphelper::OInterfaceContainerHelper2 m_NotifyListeners;
         /// modify flag
         bool            m_isModified;
 
diff --git a/connectivity/source/commontools/parameters.cxx b/connectivity/source/commontools/parameters.cxx
index dd87288..1a034ee 100644
--- a/connectivity/source/commontools/parameters.cxx
+++ b/connectivity/source/commontools/parameters.cxx
@@ -693,7 +693,7 @@ namespace dbtools
             // TODO: shouldn't we subtract all the parameters which were already visited?
         if ( nParamsLeft )
         {
-            ::cppu::OInterfaceIteratorHelper aIter( m_aParameterListeners );
+            ::comphelper::OInterfaceIteratorHelper2 aIter( m_aParameterListeners );
             Reference< XPropertySet > xProp = m_xComponent;
             OSL_ENSURE(xProp.is(),"Some already released my component!");
             DatabaseParameterEvent aEvent( xProp.get(), m_pOuterParameters.get() );
diff --git a/connectivity/source/drivers/hsqldb/HTables.cxx b/connectivity/source/drivers/hsqldb/HTables.cxx
index 0a7c703..a519e92 100644
--- a/connectivity/source/drivers/hsqldb/HTables.cxx
+++ b/connectivity/source/drivers/hsqldb/HTables.cxx
@@ -175,7 +175,7 @@ void OTables::appendNew(const OUString& _rsNewTable)
 
     // notify our container listeners
     ContainerEvent aEvent(static_cast<XContainer*>(this), makeAny(_rsNewTable), Any(), Any());
-    OInterfaceIteratorHelper aListenerLoop(m_aContainerListeners);
+    OInterfaceIteratorHelper2 aListenerLoop(m_aContainerListeners);
     while (aListenerLoop.hasMoreElements())
         static_cast<XContainerListener*>(aListenerLoop.next())->elementInserted(aEvent);
 }
diff --git a/connectivity/source/drivers/mysql/YTables.cxx b/connectivity/source/drivers/mysql/YTables.cxx
index b8c3237..5c1e2da 100644
--- a/connectivity/source/drivers/mysql/YTables.cxx
+++ b/connectivity/source/drivers/mysql/YTables.cxx
@@ -196,7 +196,7 @@ void OTables::appendNew(const OUString& _rsNewTable)
 
     // notify our container listeners
     ContainerEvent aEvent(static_cast<XContainer*>(this), makeAny(_rsNewTable), Any(), Any());
-    OInterfaceIteratorHelper aListenerLoop(m_aContainerListeners);
+    OInterfaceIteratorHelper2 aListenerLoop(m_aContainerListeners);
     while (aListenerLoop.hasMoreElements())
         static_cast<XContainerListener*>(aListenerLoop.next())->elementInserted(aEvent);
 }
diff --git a/connectivity/source/inc/hsqldb/HConnection.hxx b/connectivity/source/inc/hsqldb/HConnection.hxx
index 1db8caf..309c033 100644
--- a/connectivity/source/inc/hsqldb/HConnection.hxx
+++ b/connectivity/source/inc/hsqldb/HConnection.hxx
@@ -27,7 +27,7 @@
 #include <com/sun/star/ui/dialogs/XExecutableDialog.hpp>
 #include <cppuhelper/compbase.hxx>
 #include <comphelper/uno3.hxx>
-#include <cppuhelper/interfacecontainer.hxx>
+#include <comphelper/interfacecontainer2.hxx>
 
 namespace connectivity
 {
@@ -57,7 +57,7 @@ namespace connectivity
                                 ,public IMethodGuardAccess
         {
         private:
-            ::cppu::OInterfaceContainerHelper                                                           m_aFlushListeners;
+            ::comphelper::OInterfaceContainerHelper2                                                          m_aFlushListeners;
             ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDriver >                         m_xDriver;
             ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >                m_xContext;
             bool                                                                                        m_bIni;
diff --git a/connectivity/source/sdbcx/VCollection.cxx b/connectivity/source/sdbcx/VCollection.cxx
index f2be688..5b4e965 100644
--- a/connectivity/source/sdbcx/VCollection.cxx
+++ b/connectivity/source/sdbcx/VCollection.cxx
@@ -422,7 +422,7 @@ void OCollection::notifyElementRemoved(const OUString& _sName)
 {
     ContainerEvent aEvent(static_cast<XContainer*>(this), makeAny(_sName), Any(), Any());
     // note that xExistent may be empty, in case somebody removed the data source while it is not alive at this moment
-    OInterfaceIteratorHelper aListenerLoop(m_aContainerListeners);
+    OInterfaceIteratorHelper2 aListenerLoop(m_aContainerListeners);
     while (aListenerLoop.hasMoreElements())
         static_cast<XContainerListener*>(aListenerLoop.next())->elementRemoved(aEvent);
 }
@@ -518,7 +518,7 @@ void OCollection::renameObject(const OUString& _sOldName, const OUString& _sNewN
     {
         ContainerEvent aEvent(static_cast<XContainer*>(this), makeAny(_sNewName), makeAny(m_pElements->getObject(_sNewName)),makeAny(_sOldName));
         // note that xExistent may be empty, in case somebody removed the data source while it is not alive at this moment
-        OInterfaceIteratorHelper aListenerLoop(m_aContainerListeners);
+        OInterfaceIteratorHelper2 aListenerLoop(m_aContainerListeners);
         while (aListenerLoop.hasMoreElements())
             static_cast<XContainerListener*>(aListenerLoop.next())->elementReplaced(aEvent);
     }
diff --git a/dbaccess/source/core/api/RowSet.cxx b/dbaccess/source/core/api/RowSet.cxx
index 58e4508..ae66546 100644
--- a/dbaccess/source/core/api/RowSet.cxx
+++ b/dbaccess/source/core/api/RowSet.cxx
@@ -103,26 +103,25 @@ com_sun_star_comp_dba_ORowSet_get_implementation(css::uno::XComponentContext* co
 }
 
 #define NOTIFY_LISTENERS_CHECK(_rListeners,T,method)                             \
-    Sequence< Reference< XInterface > > aListenerSeq = _rListeners.getElements(); \
+    std::vector< Reference< XInterface > > aListenerSeq = _rListeners.getElements(); \
                                                                                   \
-    const Reference< XInterface >* pxIntBegin = aListenerSeq.getConstArray();     \
-    const Reference< XInterface >* pxInt = pxIntBegin + aListenerSeq.getLength(); \
+    auto it = aListenerSeq.rbegin();                                              \
+    const auto itEnd = aListenerSeq.rend();                                       \
                                                                                   \
     _rGuard.clear();                                                              \
     bool bCheck = true;                                                           \
-    while( pxInt > pxIntBegin && bCheck )                                         \
+    for ( ; it != itEnd; )                                                        \
     {                                                                             \
         try                                                                       \
         {                                                                         \
-            while( pxInt > pxIntBegin && bCheck )                                 \
-            {                                                                     \
-                --pxInt;                                                          \
-                bCheck = static_cast< T* >( pxInt->get() )->method(aEvt);         \
-            }                                                                     \
+            bCheck = static_cast< T* >( it->get() )->method(aEvt);                \
+            if (!bCheck)                                                          \
+                break;                                                            \
         }                                                                         \
         catch( RuntimeException& )                                                \
         {                                                                         \
         }                                                                         \
+        ++it;                                                                     \
     }                                                                             \
     _rGuard.reset();
 
@@ -1514,7 +1513,7 @@ void ORowSet::approveExecution() throw (RowSetVetoException, RuntimeException)
     ::osl::MutexGuard aGuard( m_aColumnsMutex );
     EventObject aEvt(*this);
 
-    OInterfaceIteratorHelper aApproveIter( m_aApproveListeners );
+    OInterfaceIteratorHelper2 aApproveIter( m_aApproveListeners );
     while ( aApproveIter.hasMoreElements() )
     {
         Reference< XRowSetApproveListener > xListener( static_cast< XRowSetApproveListener* >( aApproveIter.next() ) );
diff --git a/dbaccess/source/core/api/RowSet.hxx b/dbaccess/source/core/api/RowSet.hxx
index 75822a4..4bc14a8 100644
--- a/dbaccess/source/core/api/RowSet.hxx
+++ b/dbaccess/source/core/api/RowSet.hxx
@@ -42,6 +42,7 @@
 #include <com/sun/star/sdb/XRowsChangeBroadcaster.hpp>
 
 #include <cppuhelper/compbase12.hxx>
+#include <comphelper/interfacecontainer2.hxx>
 #include <connectivity/paramwrapper.hxx>
 #include <connectivity/FValue.hxx>
 #include <connectivity/warningscontainer.hxx>
@@ -91,9 +92,9 @@ namespace dbaccess
         ::std::vector<bool>                         m_aParametersSet;
         ::std::vector<bool>                         m_aReadOnlyDataColumns;
 
-        ::cppu::OInterfaceContainerHelper           m_aRowsetListeners;
-        ::cppu::OInterfaceContainerHelper           m_aApproveListeners;
-        ::cppu::OInterfaceContainerHelper           m_aRowsChangeListener;
+        ::comphelper::OInterfaceContainerHelper2    m_aRowsetListeners;
+        ::comphelper::OInterfaceContainerHelper2    m_aApproveListeners;
+        ::comphelper::OInterfaceContainerHelper2    m_aRowsChangeListener;
 
         ::dbtools::WarningsContainer                m_aWarnings;
 
diff --git a/dbaccess/source/core/dataaccess/bookmarkcontainer.cxx b/dbaccess/source/core/dataaccess/bookmarkcontainer.cxx
index a7490bd..173ed88 100644
--- a/dbaccess/source/core/dataaccess/bookmarkcontainer.cxx
+++ b/dbaccess/source/core/dataaccess/bookmarkcontainer.cxx
@@ -107,7 +107,7 @@ void SAL_CALL OBookmarkContainer::insertByName( const OUString& _rName, const An
     if (m_aContainerListeners.getLength())
     {
         ContainerEvent aEvent(*this, makeAny(_rName), makeAny(sNewLink), Any());
-        OInterfaceIteratorHelper aListenerIterator(m_aContainerListeners);
+        OInterfaceIteratorHelper2 aListenerIterator(m_aContainerListeners);
         while (aListenerIterator.hasMoreElements())
             static_cast< XContainerListener* >(aListenerIterator.next())->elementInserted(aEvent);
     }
@@ -137,7 +137,7 @@ void SAL_CALL OBookmarkContainer::removeByName( const OUString& _rName ) throw(N
     if (m_aContainerListeners.getLength())
     {
         ContainerEvent aEvent(*this, makeAny(_rName), makeAny(sOldBookmark), Any());
-        OInterfaceIteratorHelper aListenerIterator(m_aContainerListeners);
+        OInterfaceIteratorHelper2 aListenerIterator(m_aContainerListeners);
         while (aListenerIterator.hasMoreElements())
             static_cast< XContainerListener* >(aListenerIterator.next())->elementRemoved(aEvent);
     }
@@ -172,7 +172,7 @@ void SAL_CALL OBookmarkContainer::replaceByName( const OUString& _rName, const A
     if (m_aContainerListeners.getLength())
     {
         ContainerEvent aEvent(*this, makeAny(_rName), makeAny(sNewLink), makeAny(sOldLink));
-        OInterfaceIteratorHelper aListenerIterator(m_aContainerListeners);
+        OInterfaceIteratorHelper2 aListenerIterator(m_aContainerListeners);
         while (aListenerIterator.hasMoreElements())
             static_cast< XContainerListener* >(aListenerIterator.next())->elementReplaced(aEvent);
     }
diff --git a/dbaccess/source/core/dataaccess/bookmarkcontainer.hxx b/dbaccess/source/core/dataaccess/bookmarkcontainer.hxx
index d1e2f4d..63a99c9 100644
--- a/dbaccess/source/core/dataaccess/bookmarkcontainer.hxx
+++ b/dbaccess/source/core/dataaccess/bookmarkcontainer.hxx
@@ -25,7 +25,7 @@
 #include <map>
 #include <vector>
 
-#include <cppuhelper/interfacecontainer.hxx>
+#include <comphelper/interfacecontainer2.hxx>
 #include <cppuhelper/implbase.hxx>
 #include <osl/mutex.hxx>
 #include <com/sun/star/container/XChild.hpp>
@@ -64,7 +64,7 @@ protected:
 
 protected:
     ::cppu::OWeakObject&    m_rParent;      // for the ref counting
-    ::cppu::OInterfaceContainerHelper
+    ::comphelper::OInterfaceContainerHelper2
                             m_aContainerListeners;
     ::osl::Mutex&           m_rMutex;
 
diff --git a/dbaccess/source/core/dataaccess/databasecontext.hxx b/dbaccess/source/core/dataaccess/databasecontext.hxx
index cf86230..1eb7233 100644
--- a/dbaccess/source/core/dataaccess/databasecontext.hxx
+++ b/dbaccess/source/core/dataaccess/databasecontext.hxx
@@ -106,7 +106,7 @@ protected:
         // recreated afterwards. So it's our (the context's) responsibility to store the session-persistent
         // properties.
 
-    ::cppu::OInterfaceContainerHelper       m_aContainerListeners;
+    ::comphelper::OInterfaceContainerHelper2       m_aContainerListeners;
     DatabaseDocumentLoader*                 m_pDatabaseDocumentLoader;
 
 public:
diff --git a/dbaccess/source/core/dataaccess/databasedocument.hxx b/dbaccess/source/core/dataaccess/databasedocument.hxx
index 89d1b17..06f2c6a 100644
--- a/dbaccess/source/core/dataaccess/databasedocument.hxx
+++ b/dbaccess/source/core/dataaccess/databasedocument.hxx
@@ -165,9 +165,9 @@ class ODatabaseDocument :public ModelDependentComponent             // ModelDepe
     typedef std::map< OUString, css::uno::Reference< css::frame::XUntitledNumbers > > TNumberedController;
     css::uno::Reference< css::ui::XUIConfigurationManager2>                                     m_xUIConfigurationManager;
 
-    ::cppu::OInterfaceContainerHelper                                                           m_aModifyListeners;
-    ::cppu::OInterfaceContainerHelper                                                           m_aCloseListener;
-    ::cppu::OInterfaceContainerHelper                                                           m_aStorageListeners;
+    ::comphelper::OInterfaceContainerHelper2                                                           m_aModifyListeners;
+    ::comphelper::OInterfaceContainerHelper2                                                           m_aCloseListener;
+    ::comphelper::OInterfaceContainerHelper2                                                           m_aStorageListeners;
 
     DocumentEvents*                                                                             m_pEventContainer;
     ::rtl::Reference< DocumentEventExecutor >                                                   m_pEventExecutor;
diff --git a/dbaccess/source/core/dataaccess/databaseregistrations.cxx b/dbaccess/source/core/dataaccess/databaseregistrations.cxx
index e132fbe..3a6aac4 100644
--- a/dbaccess/source/core/dataaccess/databaseregistrations.cxx
+++ b/dbaccess/source/core/dataaccess/databaseregistrations.cxx
@@ -20,7 +20,7 @@
 #include <com/sun/star/sdb/XDatabaseRegistrations.hpp>
 
 #include <cppuhelper/basemutex.hxx>
-#include <cppuhelper/interfacecontainer.hxx>
+#include <comphelper/interfacecontainer2.hxx>
 #include <cppuhelper/implbase1.hxx>
 #include <rtl/ustrbuf.hxx>
 #include <unotools/pathoptions.hxx>
@@ -134,7 +134,7 @@ namespace dbaccess
     private:
         Reference<XComponentContext>        m_aContext;
         ::utl::OConfigurationTreeRoot       m_aConfigurationRoot;
-        ::cppu::OInterfaceContainerHelper   m_aRegistrationListeners;
+        ::comphelper::OInterfaceContainerHelper2  m_aRegistrationListeners;
     };
 
     // DatabaseRegistrations - implementation
diff --git a/dbaccess/source/core/dataaccess/datasource.hxx b/dbaccess/source/core/dataaccess/datasource.hxx
index 446b846..5c898ae 100644
--- a/dbaccess/source/core/dataaccess/datasource.hxx
+++ b/dbaccess/source/core/dataaccess/datasource.hxx
@@ -83,7 +83,7 @@ class ODatabaseSource   :public ModelDependentComponent // must be first
 private:
     using ODatabaseSource_Base::rBHelper;
     css::uno::Reference<OBookmarkContainer> m_xBookmarks;
-    ::cppu::OInterfaceContainerHelper       m_aFlushListeners;
+    ::comphelper::OInterfaceContainerHelper2       m_aFlushListeners;
 
 private:
     virtual ~ODatabaseSource();
diff --git a/dbaccess/source/core/dataaccess/definitioncontainer.cxx b/dbaccess/source/core/dataaccess/definitioncontainer.cxx
index fc601b4..8535b30 100644
--- a/dbaccess/source/core/dataaccess/definitioncontainer.cxx
+++ b/dbaccess/source/core/dataaccess/definitioncontainer.cxx
@@ -289,7 +289,7 @@ void ODefinitionContainer::notifyByName( ResettableMutexGuard& _rGuard, const OU
 {
     bool bApprove = ( _eType == ApproveListeners );
 
-    ::cppu::OInterfaceContainerHelper& rContainer( bApprove ? m_aApproveListeners : m_aContainerListeners );
+    ::comphelper::OInterfaceContainerHelper2& rContainer( bApprove ? m_aApproveListeners : m_aContainerListeners );
     if ( !rContainer.getLength() )
         return;
 
diff --git a/dbaccess/source/core/dataaccess/documenteventnotifier.cxx b/dbaccess/source/core/dataaccess/documenteventnotifier.cxx
index 2dd4838..b685806 100644
--- a/dbaccess/source/core/dataaccess/documenteventnotifier.cxx
+++ b/dbaccess/source/core/dataaccess/documenteventnotifier.cxx
@@ -22,7 +22,7 @@
 #include <com/sun/star/frame/DoubleInitializationException.hpp>
 
 #include <comphelper/asyncnotification.hxx>
-#include <cppuhelper/interfacecontainer.hxx>
+#include <comphelper/interfacecontainer2.hxx>
 #include <cppuhelper/weak.hxx>
 #include <tools/diagnose_ex.h>
 
@@ -59,8 +59,8 @@ namespace dbaccess
         bool                                                    m_bInitialized;
         bool                                                    m_bDisposed;
         ::rtl::Reference< ::comphelper::AsyncEventNotifier >    m_pEventBroadcaster;
-        ::cppu::OInterfaceContainerHelper                       m_aLegacyEventListeners;
-        ::cppu::OInterfaceContainerHelper                       m_aDocumentEventListeners;
+        ::comphelper::OInterfaceContainerHelper2                      m_aLegacyEventListeners;
+        ::comphelper::OInterfaceContainerHelper2                      m_aDocumentEventListeners;
 
     public:
         DocumentEventNotifier_Impl( ::cppu::OWeakObject& _rBroadcasterDocument, ::osl::Mutex& _rMutex )
diff --git a/dbaccess/source/core/dataaccess/intercept.hxx b/dbaccess/source/core/dataaccess/intercept.hxx
index 6d80e4f..fb4c423 100644
--- a/dbaccess/source/core/dataaccess/intercept.hxx
+++ b/dbaccess/source/core/dataaccess/intercept.hxx
@@ -131,7 +131,7 @@ private:
 
     css::uno::Sequence< OUString >      m_aInterceptedURL;
 
-    cppu::OInterfaceContainerHelper*    m_pDisposeEventListeners;
+    comphelper::OInterfaceContainerHelper2*    m_pDisposeEventListeners;
     PropertyChangeListenerContainer*    m_pStatCL;
 };
 
diff --git a/dbaccess/source/core/inc/ContentHelper.hxx b/dbaccess/source/core/inc/ContentHelper.hxx
index 3e5c74e..768b4b9 100644
--- a/dbaccess/source/core/inc/ContentHelper.hxx
+++ b/dbaccess/source/core/inc/ContentHelper.hxx
@@ -32,6 +32,7 @@
 #include <com/sun/star/embed/XEmbeddedObject.hpp>
 #include <com/sun/star/lang/XUnoTunnel.hpp>
 #include <cppuhelper/compbase.hxx>
+#include <comphelper/interfacecontainer2.hxx>
 #include <comphelper/broadcasthelper.hxx>
 #include <comphelper/uno3.hxx>
 #include <com/sun/star/beans/Property.hpp>
@@ -101,7 +102,7 @@ namespace dbaccess
         void impl_rename_throw(const OUString& _sNewName,bool _bNotify = true);
 
     protected:
-        ::cppu::OInterfaceContainerHelper       m_aContentListeners;
+        ::comphelper::OInterfaceContainerHelper2      m_aContentListeners;
         PropertyChangeListenerContainer         m_aPropertyChangeListeners;
         css::uno::Reference< css::uno::XInterface >
                                                 m_xParentContainer;
diff --git a/dbaccess/source/core/inc/definitioncontainer.hxx b/dbaccess/source/core/inc/definitioncontainer.hxx
index 1f7c594..bdefec3 100644
--- a/dbaccess/source/core/inc/definitioncontainer.hxx
+++ b/dbaccess/source/core/inc/definitioncontainer.hxx
@@ -120,9 +120,9 @@ protected:
     DocumentsIndexAccess    m_aDocuments;               // for a efficient index access
     Documents               m_aDocumentMap;             // for a efficient name access
 
-    ::cppu::OInterfaceContainerHelper
+    ::comphelper::OInterfaceContainerHelper2
                             m_aApproveListeners;
-    ::cppu::OInterfaceContainerHelper
+    ::comphelper::OInterfaceContainerHelper2
                             m_aContainerListeners;
 
     bool                    m_bInPropertyChange;
diff --git a/dbaccess/source/ui/app/AppController.cxx b/dbaccess/source/ui/app/AppController.cxx
index 5d1d893e..3a391f5 100644
--- a/dbaccess/source/ui/app/AppController.cxx
+++ b/dbaccess/source/ui/app/AppController.cxx
@@ -187,7 +187,7 @@ Reference< XInterface > SAL_CALL OApplicationController::Create(const Reference<
 class SelectionNotifier : public ::boost::noncopyable
 {
 private:
-    ::cppu::OInterfaceContainerHelper   m_aSelectionListeners;
+    ::comphelper::OInterfaceContainerHelper2   m_aSelectionListeners;
     ::cppu::OWeakObject&                m_rContext;
     sal_Int32                           m_nSelectionNestingLevel;
 
@@ -2340,7 +2340,7 @@ IController& OApplicationController::getCommandController()
     return *this;
 }
 
-::cppu::OInterfaceContainerHelper* OApplicationController::getContextMenuInterceptors()
+::comphelper::OInterfaceContainerHelper2* OApplicationController::getContextMenuInterceptors()
 {
     return &m_aContextMenuInterceptors;
 }
diff --git a/dbaccess/source/ui/app/AppController.hxx b/dbaccess/source/ui/app/AppController.hxx
index 7da6514..e73f1ea 100644
--- a/dbaccess/source/ui/app/AppController.hxx
+++ b/dbaccess/source/ui/app/AppController.hxx
@@ -38,6 +38,7 @@
 #include <comphelper/namedvaluecollection.hxx>
 #include <comphelper/uno3.hxx>
 #include <cppuhelper/implbase5.hxx>
+#include <comphelper/interfacecontainer2.hxx>
 #include <sot/storage.hxx>
 #include <svtools/transfer.hxx>
 #include <svx/dataaccessdescriptor.hxx>
@@ -99,7 +100,7 @@ namespace dbaui
                                 m_xDataSource;
         css::uno::Reference< css::frame::XModel >
                                 m_xModel;
-        ::cppu::OInterfaceContainerHelper
+        ::comphelper::OInterfaceContainerHelper2
                                 m_aContextMenuInterceptors;
 
         TContainerVector        m_aCurrentContainers;       // the containers where we are listener on
@@ -536,7 +537,7 @@ namespace dbaui
         // IContextMenuProvider
         virtual PopupMenu*      getContextMenu( Control& _rControl ) const override;
         virtual IController&    getCommandController() override;
-        virtual ::cppu::OInterfaceContainerHelper*
+        virtual ::comphelper::OInterfaceContainerHelper2*
                                 getContextMenuInterceptors() override;
         virtual css::uno::Any
                                 getCurrentSelection( Control& _rControl ) const override;
diff --git a/dbaccess/source/ui/browser/brwctrlr.cxx b/dbaccess/source/ui/browser/brwctrlr.cxx
index 36425d0..f47a075 100644
--- a/dbaccess/source/ui/browser/brwctrlr.cxx
+++ b/dbaccess/source/ui/browser/brwctrlr.cxx
@@ -154,7 +154,7 @@ class SbaXDataBrowserController::FormControllerImpl
                                          css::frame::XFrameActionListener >
 {
     friend class SbaXDataBrowserController;
-    ::cppu::OInterfaceContainerHelper   m_aActivateListeners;
+    ::comphelper::OInterfaceContainerHelper2   m_aActivateListeners;
     SbaXDataBrowserController*          m_pOwner;
 
 public:
@@ -935,7 +935,7 @@ void SAL_CALL SbaXDataBrowserController::focusGained(const FocusEvent& /*e*/) th
 {
     // notify our activate listeners (registered on the form controller aggregate)
     EventObject aEvt(*this);
-    ::cppu::OInterfaceIteratorHelper aIter(m_pFormControllerImpl->m_aActivateListeners);
+    ::comphelper::OInterfaceIteratorHelper2 aIter(m_pFormControllerImpl->m_aActivateListeners);
     while (aIter.hasMoreElements())
         static_cast<XFormControllerListener*>(aIter.next())->formActivated(aEvt);
 }
@@ -961,7 +961,7 @@ void SAL_CALL SbaXDataBrowserController::focusLost(const FocusEvent& e) throw( R
 
     // notify the listeners that the "form" we represent has been deactivated
     EventObject aEvt(*this);
-    ::cppu::OInterfaceIteratorHelper aIter(m_pFormControllerImpl->m_aActivateListeners);
+    ::comphelper::OInterfaceIteratorHelper2 aIter(m_pFormControllerImpl->m_aActivateListeners);
     while (aIter.hasMoreElements())
         static_cast<XFormControllerListener*>(aIter.next())->formDeactivated(aEvt);
 
diff --git a/dbaccess/source/ui/browser/exsrcbrw.cxx b/dbaccess/source/ui/browser/exsrcbrw.cxx
index c3d2195..e840504 100644
--- a/dbaccess/source/ui/browser/exsrcbrw.cxx
+++ b/dbaccess/source/ui/browser/exsrcbrw.cxx
@@ -123,7 +123,7 @@ void SbaExternalSourceBrowser::modified(const css::lang::EventObject& aEvent) th
 
     // multiplex this event to all my listeners
     css::lang::EventObject aEvt(*this);
-    ::cppu::OInterfaceIteratorHelper aIt(m_aModifyListeners);
+    ::comphelper::OInterfaceIteratorHelper2 aIt(m_aModifyListeners);
     while (aIt.hasMoreElements())
         static_cast< css::util::XModifyListener*>(aIt.next())->modified(aEvt);
 }
diff --git a/dbaccess/source/ui/browser/formadapter.cxx b/dbaccess/source/ui/browser/formadapter.cxx
index a25eefc..49a6a30 100644
--- a/dbaccess/source/ui/browser/formadapter.cxx
+++ b/dbaccess/source/ui/browser/formadapter.cxx
@@ -168,7 +168,7 @@ void SbaXFormAdapter::AttachForm(const Reference< css::sdbc::XRowSet >& xNewMast
         if (xLoadable->isLoaded())
         {
             css::lang::EventObject aEvt(*this);
-            ::cppu::OInterfaceIteratorHelper aIt(m_aLoadListeners);
+            ::comphelper::OInterfaceIteratorHelper2 aIt(m_aLoadListeners);
             while (aIt.hasMoreElements())
                 static_cast< css::form::XLoadListener*>(aIt.next())->unloaded(aEvt);
         }
@@ -185,7 +185,7 @@ void SbaXFormAdapter::AttachForm(const Reference< css::sdbc::XRowSet >& xNewMast
         if (xLoadable->isLoaded())
         {
             css::lang::EventObject aEvt(*this);
-            ::cppu::OInterfaceIteratorHelper aIt(m_aLoadListeners);
+            ::comphelper::OInterfaceIteratorHelper2 aIt(m_aLoadListeners);
             while (aIt.hasMoreElements())
                 static_cast< css::form::XLoadListener*>(aIt.next())->loaded(aEvt);
         }
@@ -1421,7 +1421,7 @@ void SbaXFormAdapter::implInsert(const Any& aElement, sal_Int32 nIndex, const OU
     aEvt.Source = *this;
     aEvt.Accessor <<= nIndex;
     aEvt.Element <<= xElement;
-    ::cppu::OInterfaceIteratorHelper aIt(m_aContainerListeners);
+    ::comphelper::OInterfaceIteratorHelper2 aIt(m_aContainerListeners);
     while (aIt.hasMoreElements())
         static_cast< css::container::XContainerListener*>(aIt.next())->elementInserted(aEvt);
 }
@@ -1526,7 +1526,7 @@ void SAL_CALL SbaXFormAdapter::removeByIndex(sal_Int32 _rIndex) throw( css::lang
     css::container::ContainerEvent aEvt;
     aEvt.Source = *this;
     aEvt.Element <<= xAffected;
-    ::cppu::OInterfaceIteratorHelper aIt(m_aContainerListeners);
+    ::comphelper::OInterfaceIteratorHelper2 aIt(m_aContainerListeners);
     while (aIt.hasMoreElements())
         static_cast< css::container::XContainerListener*>(aIt.next())->elementRemoved(aEvt);
 
@@ -1589,7 +1589,7 @@ void SAL_CALL SbaXFormAdapter::replaceByIndex(sal_Int32 _rIndex, const Any& Elem
     aEvt.Element <<= xElement;
     aEvt.ReplacedElement <<= xOld;
 
-    ::cppu::OInterfaceIteratorHelper aIt(m_aContainerListeners);
+    ::comphelper::OInterfaceIteratorHelper2 aIt(m_aContainerListeners);
     while (aIt.hasMoreElements())
         static_cast< css::container::XContainerListener*>(aIt.next())->elementReplaced(aEvt);
 }
diff --git a/dbaccess/source/ui/browser/sbamultiplex.cxx b/dbaccess/source/ui/browser/sbamultiplex.cxx
index 309dba9..2220ece 100644
--- a/dbaccess/source/ui/browser/sbamultiplex.cxx
+++ b/dbaccess/source/ui/browser/sbamultiplex.cxx
@@ -29,7 +29,7 @@ void SAL_CALL SbaXStatusMultiplexer::statusChanged(const css::frame::FeatureStat
 {
     m_aLastKnownStatus = e;
     m_aLastKnownStatus.Source = &m_rParent;
-    ::cppu::OInterfaceIteratorHelper aIt( *this );
+    ::comphelper::OInterfaceIteratorHelper2 aIt( *this );
     while ( aIt.hasMoreElements() )
         static_cast< css::frame::XStatusListener* >( aIt.next() )->statusChanged( m_aLastKnownStatus );
 }                                                                                       \
@@ -89,7 +89,7 @@ void SbaXPropertiesChangeMultiplexer::propertiesChange(const css::uno::Sequence<
     for (sal_Int32 i=0; i<aMulti.getLength(); ++i, ++pMulti)
         pMulti->Source = &m_rParent;
 
-    ::cppu::OInterfaceIteratorHelper aIt(*this);
+    ::comphelper::OInterfaceIteratorHelper2 aIt(*this);
     while (aIt.hasMoreElements())
         static_cast< css::beans::XPropertiesChangeListener*>(aIt.next())->propertiesChange(aMulti);
 }
diff --git a/dbaccess/source/ui/browser/unodatbr.cxx b/dbaccess/source/ui/browser/unodatbr.cxx
index 30cff7e..a19442d 100644
--- a/dbaccess/source/ui/browser/unodatbr.cxx
+++ b/dbaccess/source/ui/browser/unodatbr.cxx
@@ -3491,7 +3491,7 @@ IController& SbaTableQueryBrowser::getCommandController()
     return *this;
 }
 
-::cppu::OInterfaceContainerHelper* SbaTableQueryBrowser::getContextMenuInterceptors()
+::comphelper::OInterfaceContainerHelper2* SbaTableQueryBrowser::getContextMenuInterceptors()
 {
     return &m_aContextMenuInterceptors;
 }
diff --git a/dbaccess/source/ui/control/dbtreelistbox.cxx b/dbaccess/source/ui/control/dbtreelistbox.cxx
index d275601..7142e29 100644
--- a/dbaccess/source/ui/control/dbtreelistbox.cxx
+++ b/dbaccess/source/ui/control/dbtreelistbox.cxx
@@ -29,7 +29,7 @@
 #include <com/sun/star/frame/XFrame.hpp>
 #include <com/sun/star/util/URL.hpp>
 #include <cppuhelper/implbase.hxx>
-#include <cppuhelper/interfacecontainer.hxx>
+#include <comphelper/interfacecontainer2.hxx>
 #include <vcl/help.hxx>
 #include <vcl/commandinfoprovider.hxx>
 #include <dbaccess/IController.hxx>
@@ -565,7 +565,7 @@ std::unique_ptr<PopupMenu> DBTreeListBox::CreateContextMenu()
     // set images
     lcl_insertMenuItemImages( *pContextMenu, m_pContextMenuProvider->getCommandController() );
     // allow context menu interception
-    ::cppu::OInterfaceContainerHelper* pInterceptors = m_pContextMenuProvider->getContextMenuInterceptors();
+    ::comphelper::OInterfaceContainerHelper2* pInterceptors = m_pContextMenuProvider->getContextMenuInterceptors();
     if ( !pInterceptors || !pInterceptors->getLength() )
         return pContextMenu;
 
@@ -577,7 +577,7 @@ std::unique_ptr<PopupMenu> DBTreeListBox::CreateContextMenu()
         pContextMenu.get(), nullptr );
     aEvent.Selection = new SelectionSupplier( m_pContextMenuProvider->getCurrentSelection( *this ) );
 
-    ::cppu::OInterfaceIteratorHelper aIter( *pInterceptors );
+    ::comphelper::OInterfaceIteratorHelper2 aIter( *pInterceptors );
     bool bModifiedMenu = false;
     bool bAskInterceptors = true;
     while ( aIter.hasMoreElements() && bAskInterceptors )
diff --git a/dbaccess/source/ui/inc/callbacks.hxx b/dbaccess/source/ui/inc/callbacks.hxx
index a87ccf3..9c2a579 100644
--- a/dbaccess/source/ui/inc/callbacks.hxx
+++ b/dbaccess/source/ui/inc/callbacks.hxx
@@ -31,7 +31,7 @@ class Control;
 struct AcceptDropEvent;
 struct ExecuteDropEvent;
 
-namespace cppu { class OInterfaceContainerHelper; }
+namespace comphelper { class OInterfaceContainerHelper2; }
 
 namespace dbaui
 {
@@ -84,7 +84,7 @@ namespace dbaui
         /** returns the container of registered context menu interceptors, or NULL if the implementation
             does not support context menu interception
         */
-        virtual ::cppu::OInterfaceContainerHelper*
+        virtual ::comphelper::OInterfaceContainerHelper2*
                                 getContextMenuInterceptors() = 0;
 
         /** returns the current selection in the given control
diff --git a/dbaccess/source/ui/inc/exsrcbrw.hxx b/dbaccess/source/ui/inc/exsrcbrw.hxx
index 09c0ea6..3a533e8 100644
--- a/dbaccess/source/ui/inc/exsrcbrw.hxx
+++ b/dbaccess/source/ui/inc/exsrcbrw.hxx
@@ -34,7 +34,7 @@ namespace dbaui
                 :public SbaXDataBrowserController
                 ,public css::util::XModifyBroadcaster
     {
-        ::cppu::OInterfaceContainerHelper   m_aModifyListeners;
+        ::comphelper::OInterfaceContainerHelper2   m_aModifyListeners;
             // for multiplexing the modify events
         SbaXFormAdapter*                    m_pDataSourceImpl;
         bool                            m_bInQueryDispatch;
diff --git a/dbaccess/source/ui/inc/formadapter.hxx b/dbaccess/source/ui/inc/formadapter.hxx
index 82eb85c..c9d7093 100644
--- a/dbaccess/source/ui/inc/formadapter.hxx
+++ b/dbaccess/source/ui/inc/formadapter.hxx
@@ -136,8 +136,8 @@ namespace dbaui
         SbaXVetoableChangeMultiplexer       m_aVetoablePropertyChangeListeners;
         SbaXPropertiesChangeMultiplexer     m_aPropertiesChangeListeners;
 
-        ::cppu::OInterfaceContainerHelper   m_aDisposeListeners;
-        ::cppu::OInterfaceContainerHelper   m_aContainerListeners;
+        ::comphelper::OInterfaceContainerHelper2   m_aDisposeListeners;
+        ::comphelper::OInterfaceContainerHelper2   m_aContainerListeners;
 
         // hierarchy administration
         css::uno::Reference< css::uno::XInterface >                           m_xParent;
diff --git a/dbaccess/source/ui/inc/sbamultiplex.hxx b/dbaccess/source/ui/inc/sbamultiplex.hxx
index c5b097d..6799903 100644
--- a/dbaccess/source/ui/inc/sbamultiplex.hxx
+++ b/dbaccess/source/ui/inc/sbamultiplex.hxx
@@ -41,6 +41,7 @@
 #include <com/sun/star/frame/XStatusListener.hpp>
 #include <comphelper/uno3.hxx>
 #include <cppuhelper/interfacecontainer.hxx>
+#include <comphelper/interfacecontainer2.hxx>
 #include <cppuhelper/queryinterface.hxx>
 #include <cppuhelper/weak.hxx>
 
@@ -64,7 +65,7 @@ namespace dbaui
     class classname                                                                         \
             :public OSbaWeakSubObject                                                           \
             ,public listenerclass                                                           \
-            ,public ::cppu::OInterfaceContainerHelper                                       \
+            ,public ::comphelper::OInterfaceContainerHelper2                                       \
     {                                                                                       \
     public:                                                                                 \
         classname( ::cppu::OWeakObject& rSource,                                            \
@@ -83,7 +84,7 @@ namespace dbaui
         virtual sal_Bool SAL_CALL methodname(const eventtype& e) throw (css::uno::RuntimeException, std::exception) override;   \
 
     #define END_DECLARE_LISTENER_MULTIPLEXER()                                              \
-    /* resolve ambiguity : both OWeakObject and OInterfaceContainerHelper have these memory operators */    \
+    /* resolve ambiguity : both OWeakObject and OInterfaceContainerHelper2 have these memory operators */    \
         void * SAL_CALL operator new( size_t size ) throw() { return OSbaWeakSubObject::operator new(size); }   \
         void SAL_CALL operator delete( void * p ) throw() { OSbaWeakSubObject::operator delete(p); }    \
     };                                                                                      \
@@ -94,7 +95,7 @@ namespace dbaui
                                                                                             \
     classname::classname(::cppu::OWeakObject& rSource, ::osl::Mutex& _rMutex)               \
             :OSbaWeakSubObject(rSource)                                                     \
-            ,OInterfaceContainerHelper(_rMutex)                                             \
+            ,OInterfaceContainerHelper2(_rMutex)                                             \
     {                                                                                       \
     }                                                                                       \
                                                                                             \
@@ -120,7 +121,7 @@ namespace dbaui
     {                                                                                       \
         eventtype aMulti(e);                                                                \
         aMulti.Source = &m_rParent;                                                         \
-        ::cppu::OInterfaceIteratorHelper aIt(*this);                                        \
+        ::comphelper::OInterfaceIteratorHelper2 aIt(*this);                                        \
         while (aIt.hasMoreElements())                                                       \
             static_cast< listenerclass*>(aIt.next())->methodname(aMulti);               \
     }                                                                                       \
@@ -130,7 +131,7 @@ namespace dbaui
     {                                                                                       \
         eventtype aMulti(e);                                                                \
         aMulti.Source = &m_rParent;                                                         \
-        ::cppu::OInterfaceIteratorHelper aIt(*this);                                        \
+        ::comphelper::OInterfaceIteratorHelper2 aIt(*this);                                        \
         bool bResult = true;                                                        \
         while (bResult && aIt.hasMoreElements())                                            \
             bResult = static_cast< listenerclass*>(aIt.next())->methodname(aMulti);     \
diff --git a/dbaccess/source/ui/inc/unodatbr.hxx b/dbaccess/source/ui/inc/unodatbr.hxx
index 4c58d72..c70fa48 100644
--- a/dbaccess/source/ui/inc/unodatbr.hxx
+++ b/dbaccess/source/ui/inc/unodatbr.hxx
@@ -91,8 +91,8 @@ namespace dbaui
         svx::ODataAccessDescriptor    m_aDocumentDataSource;
             // if we're part of a document, this is the state of the DocumentDataSource slot
 
-        ::cppu::OInterfaceContainerHelper   m_aSelectionListeners;
-        ::cppu::OInterfaceContainerHelper   m_aContextMenuInterceptors;
+        ::comphelper::OInterfaceContainerHelper2   m_aSelectionListeners;
+        ::comphelper::OInterfaceContainerHelper2   m_aContextMenuInterceptors;
 
         OTableCopyHelper::DropDescriptor    m_aAsyncDrop;
         OTableCopyHelper                    m_aTableCopyHelper;
@@ -232,7 +232,7 @@ namespace dbaui
         // IContextMenuProvider
         virtual PopupMenu*      getContextMenu( Control& _rControl ) const override;
         virtual IController&    getCommandController() override;
-        virtual ::cppu::OInterfaceContainerHelper*
+        virtual ::comphelper::OInterfaceContainerHelper2*
                                 getContextMenuInterceptors() override;
         virtual css::uno::Any
                                 getCurrentSelection( Control& _rControl ) const override;
diff --git a/dbaccess/source/ui/misc/dbsubcomponentcontroller.cxx b/dbaccess/source/ui/misc/dbsubcomponentcontroller.cxx
index 1e14c3f..70154bb 100644
--- a/dbaccess/source/ui/misc/dbsubcomponentcontroller.cxx
+++ b/dbaccess/source/ui/misc/dbsubcomponentcontroller.cxx
@@ -41,6 +41,7 @@
 #include <connectivity/dbexception.hxx>
 #include <connectivity/dbtools.hxx>
 #include <cppuhelper/typeprovider.hxx>
+#include <comphelper/interfacecontainer2.hxx>
 #include <rtl/ustrbuf.hxx>
 #include <toolkit/helper/vclunohelper.hxx>
 #include <tools/debug.hxx>
@@ -126,7 +127,7 @@ namespace dbaui
         OModuleClient                   m_aModuleClient;
         ::dbtools::SQLExceptionInfo     m_aCurrentError;
 
-        ::cppu::OInterfaceContainerHelper
+        ::comphelper::OInterfaceContainerHelper2
                                         m_aModifyListeners;
 
         // <properties>
diff --git a/dbaccess/source/ui/uno/copytablewizard.cxx b/dbaccess/source/ui/uno/copytablewizard.cxx
index bdfd531..5030eeb 100644
--- a/dbaccess/source/ui/uno/copytablewizard.cxx
+++ b/dbaccess/source/ui/uno/copytablewizard.cxx
@@ -64,6 +64,7 @@
 #include <connectivity/dbtools.hxx>
 #include <cppuhelper/exc_hlp.hxx>
 #include <cppuhelper/implbase.hxx>
+#include <comphelper/interfacecontainer2.hxx>
 #include <rtl/ustrbuf.hxx>
 #include <svtools/genericunodialog.hxx>
 #include <tools/diagnose_ex.h>
@@ -346,7 +347,7 @@ private:
 
         // other
         Reference< XInteractionHandler > m_xInteractionHandler;
-        ::cppu::OInterfaceContainerHelper
+        ::comphelper::OInterfaceContainerHelper2
                                         m_aCopyTableListeners;
         sal_Int16                       m_nOverrideExecutionResult;
     };
@@ -1016,7 +1017,7 @@ bool CopyTableWizard::impl_processCopyError_nothrow( const CopyTableRowEvent& _r
     Reference< XCopyTableListener > xListener;
     try
     {
-        ::cppu::OInterfaceIteratorHelper aIter( m_aCopyTableListeners );
+        ::comphelper::OInterfaceIteratorHelper2 aIter( m_aCopyTableListeners );
         while ( aIter.hasMoreElements() )
         {
             xListener.set( aIter.next(), UNO_QUERY_THROW );
diff --git a/dtrans/source/win32/clipb/WinClipboard.cxx b/dtrans/source/win32/clipb/WinClipboard.cxx
index 3deada7..b8c83e9 100644
--- a/dtrans/source/win32/clipb/WinClipboard.cxx
+++ b/dtrans/source/win32/clipb/WinClipboard.cxx
@@ -189,7 +189,7 @@ void SAL_CALL CWinClipboard::notifyAllClipboardListener( )
         {
             aGuard.clear( );
 
-            OInterfaceContainerHelper* pICHelper = rBHelper.aLC.getContainer(
+            OInterfaceContainerHelper2* pICHelper = rBHelper.aLC.getContainer(
                 cppu::UnoType<XClipboardListener>::get());
 
             if ( pICHelper )
diff --git a/dtrans/source/win32/dnd/sourcecontext.cxx b/dtrans/source/win32/dnd/sourcecontext.cxx
index 84e54da..03ef66a 100644
--- a/dtrans/source/win32/dnd/sourcecontext.cxx
+++ b/dtrans/source/win32/dnd/sourcecontext.cxx
@@ -94,7 +94,7 @@ void SourceContext::fire_dragDropEnd( sal_Bool success, sal_Int8 effect)
     e.DragSourceContext= static_cast<XDragSourceContext*>( this);
     e.Source.set( static_cast<XDragSourceContext*>( this), UNO_QUERY);
 
-    OInterfaceContainerHelper* pContainer= rBHelper.getContainer(
+    OInterfaceContainerHelper2* pContainer= rBHelper.getContainer(
         cppu::UnoType<XDragSourceListener>::get());
 
     if( pContainer)
@@ -121,7 +121,7 @@ void SourceContext::fire_dropActionChanged( sal_Int8 dropAction, sal_Int8 userAc
         e.DragSourceContext= static_cast<XDragSourceContext*>( this);
         e.Source.set( static_cast<XDragSourceContext*>( this), UNO_QUERY);
 
-        OInterfaceContainerHelper* pContainer= rBHelper.getContainer(
+        OInterfaceContainerHelper2* pContainer= rBHelper.getContainer(
             cppu::UnoType<XDragSourceListener>::get());
 
         if( pContainer)
diff --git a/dtrans/source/win32/dnd/target.cxx b/dtrans/source/win32/dnd/target.cxx
index d7247f9..dccbe88 100644
--- a/dtrans/source/win32/dnd/target.cxx
+++ b/dtrans/source/win32/dnd/target.cxx
@@ -488,7 +488,7 @@ HRESULT DropTarget::Drop( IDataObject  * /*pDataObj*/,
 
 void DropTarget::fire_drop( const DropTargetDropEvent& dte)
 {
-    OInterfaceContainerHelper* pContainer= rBHelper.getContainer( cppu::UnoType<XDropTargetListener>::get());
+    OInterfaceContainerHelper2* pContainer= rBHelper.getContainer( cppu::UnoType<XDropTargetListener>::get());
     if( pContainer)
     {
         OInterfaceIteratorHelper iter( *pContainer);
@@ -502,7 +502,7 @@ void DropTarget::fire_drop( const DropTargetDropEvent& dte)
 
 void DropTarget::fire_dragEnter( const DropTargetDragEnterEvent& e )
 {
-    OInterfaceContainerHelper* pContainer= rBHelper.getContainer( cppu::UnoType<XDropTargetListener>::get());
+    OInterfaceContainerHelper2* pContainer= rBHelper.getContainer( cppu::UnoType<XDropTargetListener>::get());
     if( pContainer)
     {
         OInterfaceIteratorHelper iter( *pContainer);
@@ -516,7 +516,7 @@ void DropTarget::fire_dragEnter( const DropTargetDragEnterEvent& e )
 
 void DropTarget::fire_dragExit( const DropTargetEvent& dte )
 {
-    OInterfaceContainerHelper* pContainer= rBHelper.getContainer( cppu::UnoType<XDropTargetListener>::get());
+    OInterfaceContainerHelper2* pContainer= rBHelper.getContainer( cppu::UnoType<XDropTargetListener>::get());
 
     if( pContainer)
     {
@@ -531,7 +531,7 @@ void DropTarget::fire_dragExit( const DropTargetEvent& dte )
 
 void DropTarget::fire_dragOver( const DropTargetDragEvent& dtde )
 {
-    OInterfaceContainerHelper* pContainer= rBHelper.getContainer( cppu::UnoType<XDropTargetListener>::get());

... etc. - the rest is truncated


More information about the Libreoffice-commits mailing list