slideshow/source/engine/slide/shapemanagerimpl.cxx |   11 +++++------
 slideshow/source/engine/slide/shapemanagerimpl.hxx |    3 ++-
 slideshow/source/engine/slideshowimpl.cxx          |   19 ++++++++++---------
 slideshow/source/inc/shapemaps.hxx                 |    5 +++--
 sot/source/unoolestorage/xolesimplestorage.cxx     |    2 +-
 sot/source/unoolestorage/xolesimplestorage.hxx     |    4 ++--
 6 files changed, 23 insertions(+), 21 deletions(-)

New commits:
commit ba8e7113fa8172533be736a25f936fc52f96e6a4
Author:     Noel Grandin <noelgran...@gmail.com>
AuthorDate: Sun Nov 28 13:06:24 2021 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Sun Nov 28 18:11:00 2021 +0100

    use more OInterfaceContainerHelper3 in slideshow
    
    Change-Id: I8f098b57411758cfbb5d5f41e319cf085a23f66b
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125973
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/slideshow/source/engine/slide/shapemanagerimpl.cxx 
b/slideshow/source/engine/slide/shapemanagerimpl.cxx
index 73c7cda1ac02..7ef3f455996f 100644
--- a/slideshow/source/engine/slide/shapemanagerimpl.cxx
+++ b/slideshow/source/engine/slide/shapemanagerimpl.cxx
@@ -161,13 +161,13 @@ bool ShapeManagerImpl::handleMouseReleased( 
awt::MouseEvent const& e )
         // shape hit, and shape is visible. Raise
         // event.
 
-        std::shared_ptr<comphelper::OInterfaceContainerHelper2> const pCont(
-            aCurrBroadcaster->second );
+        
std::shared_ptr<comphelper::OInterfaceContainerHelper3<css::presentation::XShapeEventListener>>
 const & pCont =
+            aCurrBroadcaster->second;
         uno::Reference<drawing::XShape> const xShape(
             aCurrBroadcaster->first->getXShape() );
 
         // DON'T do anything with /this/ after this point!
-        pCont->forEach<presentation::XShapeEventListener>(
+        pCont->forEach(
             [&xShape, &e]( const uno::Reference< 
presentation::XShapeEventListener >& rListener )
             { return rListener->click( xShape, e ); } );
 
@@ -297,9 +297,8 @@ void ShapeManagerImpl::revokeSubset( const 
AttributableShapeSharedPtr& rOrigShap
 bool ShapeManagerImpl::listenerAdded(
     const uno::Reference<drawing::XShape>& xShape )
 {
-    ShapeEventListenerMap::const_iterator aIter;
-    if( (aIter = mrGlobalListenersMap.find( xShape )) ==
-        mrGlobalListenersMap.end() )
+    ShapeEventListenerMap::const_iterator aIter = mrGlobalListenersMap.find( 
xShape );
+    if( aIter == mrGlobalListenersMap.end() )
     {
         ENSURE_OR_RETURN_FALSE(false,
                           "ShapeManagerImpl::listenerAdded(): global "
diff --git a/slideshow/source/engine/slide/shapemanagerimpl.hxx 
b/slideshow/source/engine/slide/shapemanagerimpl.hxx
index 5025450326e1..20bbe0340242 100644
--- a/slideshow/source/engine/slide/shapemanagerimpl.hxx
+++ b/slideshow/source/engine/slide/shapemanagerimpl.hxx
@@ -22,6 +22,7 @@
 #include <com/sun/star/drawing/XDrawPage.hpp>
 #include <com/sun/star/uno/Reference.hxx>
 
+#include <comphelper/interfacecontainer3.hxx>
 #include <shape.hxx>
 #include <subsettableshapemanager.hxx>
 #include <eventmultiplexer.hxx>
@@ -157,7 +158,7 @@ private:
 
 
     typedef std::map<ShapeSharedPtr,
-                     std::shared_ptr< ::comphelper::OInterfaceContainerHelper2 
>,
+                     std::shared_ptr< 
::comphelper::OInterfaceContainerHelper3<css::presentation::XShapeEventListener>
 >,
                      Shape::lessThanShape>        ShapeToListenersMap;
     typedef std::map<ShapeSharedPtr, sal_Int16,
                        Shape::lessThanShape>      ShapeToCursorMap;
diff --git a/slideshow/source/engine/slideshowimpl.cxx 
b/slideshow/source/engine/slideshowimpl.cxx
index 5647170f9c4d..2cd77518bb19 100644
--- a/slideshow/source/engine/slideshowimpl.cxx
+++ b/slideshow/source/engine/slideshowimpl.cxx
@@ -25,6 +25,7 @@
 #include <cppuhelper/interfacecontainer.h>
 #include <cppuhelper/supportsservice.hxx>
 
+#include <comphelper/interfacecontainer3.hxx>
 #include <comphelper/scopeguard.hxx>
 #include <comphelper/storagehelper.hxx>
 #include <cppcanvas/polypolygon.hxx>
@@ -400,7 +401,7 @@ private:
     UnoViewContainer                        maViewContainer;
 
     /// all registered slide show listeners
-    comphelper::OInterfaceContainerHelper2         maListenerContainer;
+    comphelper::OInterfaceContainerHelper3<presentation::XSlideShowListener> 
maListenerContainer;
 
     /// map of vectors, containing all registered listeners for a shape
     ShapeEventListenerMap                   maShapeEventListeners;
@@ -1161,7 +1162,7 @@ void SlideShowImpl::displaySlide(
         }
     } // finally
 
-    maListenerContainer.forEach<presentation::XSlideShowListener>(
+    maListenerContainer.forEach(
         [](uno::Reference<presentation::XSlideShowListener> const& xListener)
         {
             xListener->slideTransitionStarted();
@@ -1195,7 +1196,7 @@ void SlideShowImpl::redisplayCurrentSlide()
         makeEvent( [this] () { this->notifySlideTransitionEnded(true); },
             "SlideShowImpl::notifySlideTransitionEnded"));
 
-    maListenerContainer.forEach<presentation::XSlideShowListener>(
+    maListenerContainer.forEach(
         [](uno::Reference<presentation::XSlideShowListener> const& xListener)
         {
             xListener->slideTransitionStarted();
@@ -1832,7 +1833,7 @@ void SlideShowImpl::addShapeEventListener(
         // no entry for this shape -> create one
         aIter = maShapeEventListeners.emplace(
                 xShape,
-                std::make_shared<comphelper::OInterfaceContainerHelper2>(
+                
std::make_shared<comphelper::OInterfaceContainerHelper3<css::presentation::XShapeEventListener>>(
                     m_aMutex)).first;
     }
 
@@ -2252,7 +2253,7 @@ void SlideShowImpl::notifySlideAnimationsEnded()
         }
     } // finally
 
-    maListenerContainer.forEach<presentation::XSlideShowListener>(
+    maListenerContainer.forEach(
         [](uno::Reference<presentation::XSlideShowListener> const& xListener)
         {
             xListener->slideAnimationsEnded();
@@ -2298,7 +2299,7 @@ void SlideShowImpl::notifySlideEnded (const bool bReverse)
                  // shape animations (drawing layer and
                  // GIF) will not be stopped.
 
-    maListenerContainer.forEach<presentation::XSlideShowListener>(
+    maListenerContainer.forEach(
         [&bReverse]( const uno::Reference< presentation::XSlideShowListener >& 
xListener )
         { return xListener->slideEnded( bReverse ); } );
 }
@@ -2307,7 +2308,7 @@ bool SlideShowImpl::notifyHyperLinkClicked( OUString 
const& hyperLink )
 {
     osl::MutexGuard const guard( m_aMutex );
 
-    maListenerContainer.forEach<presentation::XSlideShowListener>(
+    maListenerContainer.forEach(
         [&hyperLink]( const uno::Reference< presentation::XSlideShowListener 
>& xListener )
         { return xListener->hyperLinkClicked( hyperLink ); } );
     return true;
@@ -2325,14 +2326,14 @@ bool SlideShowImpl::handleAnimationEvent( const 
AnimationNodeSharedPtr& rNode )
     switch( rNode->getState() )
     {
     case AnimationNode::ACTIVE:
-        maListenerContainer.forEach<presentation::XSlideShowListener>(
+        maListenerContainer.forEach(
             [&xNode]( const uno::Reference< animations::XAnimationListener >& 
xListener )
             { return xListener->beginEvent( xNode ); } );
         break;
 
     case AnimationNode::FROZEN:
     case AnimationNode::ENDED:
-        maListenerContainer.forEach<presentation::XSlideShowListener>(
+        maListenerContainer.forEach(
             [&xNode]( const uno::Reference< animations::XAnimationListener >& 
xListener )
             { return xListener->endEvent( xNode ); } );
         if(mpCurrentSlide->isPaintOverlayActive())
diff --git a/slideshow/source/inc/shapemaps.hxx 
b/slideshow/source/inc/shapemaps.hxx
index aefd8c5df423..cb5ba095089e 100644
--- a/slideshow/source/inc/shapemaps.hxx
+++ b/slideshow/source/inc/shapemaps.hxx
@@ -20,8 +20,9 @@
 #ifndef INCLUDED_SLIDESHOW_SOURCE_INC_SHAPEMAPS_HXX
 #define INCLUDED_SLIDESHOW_SOURCE_INC_SHAPEMAPS_HXX
 
-#include <comphelper/interfacecontainer2.hxx>
+#include <comphelper/interfacecontainer3.hxx>
 #include <com/sun/star/uno/Reference.hxx>
+#include <com/sun/star/presentation/XShapeEventListener.hpp>
 
 #include <memory>
 #include <map>
@@ -34,7 +35,7 @@ namespace slideshow::internal
     {
         /// Maps XShape to shape listener
         typedef ::std::map< css::uno::Reference< css::drawing::XShape>,
-                            std::shared_ptr< 
::comphelper::OInterfaceContainerHelper2 >
+                            std::shared_ptr< 
::comphelper::OInterfaceContainerHelper3<css::presentation::XShapeEventListener>
 >
                             >                  ShapeEventListenerMap;
 
         /// Maps XShape to mouse cursor
commit 8d9c4792129e3dcf263ffffe39324c94b2ffe2bf
Author:     Noel Grandin <noelgran...@gmail.com>
AuthorDate: Sun Nov 28 13:13:44 2021 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Sun Nov 28 18:10:49 2021 +0100

    use more OInterfaceContainerHelper3 in sot
    
    Change-Id: I4d8fbb90a9850199caa29e97f2080fd49c48bcef
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125974
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/sot/source/unoolestorage/xolesimplestorage.cxx 
b/sot/source/unoolestorage/xolesimplestorage.cxx
index 8ea0907b38e5..565de5a5b63a 100644
--- a/sot/source/unoolestorage/xolesimplestorage.cxx
+++ b/sot/source/unoolestorage/xolesimplestorage.cxx
@@ -580,7 +580,7 @@ void SAL_CALL OLESimpleStorage::addEventListener(
         throw lang::DisposedException();
 
     if ( !m_pListenersContainer )
-        m_pListenersContainer = new ::comphelper::OInterfaceContainerHelper2( 
m_aMutex );
+        m_pListenersContainer = new 
::comphelper::OInterfaceContainerHelper3<css::lang::XEventListener>( m_aMutex );
 
     m_pListenersContainer->addInterface( xListener );
 }
diff --git a/sot/source/unoolestorage/xolesimplestorage.hxx 
b/sot/source/unoolestorage/xolesimplestorage.hxx
index 2ec9f715d873..765cd87caf12 100644
--- a/sot/source/unoolestorage/xolesimplestorage.hxx
+++ b/sot/source/unoolestorage/xolesimplestorage.hxx
@@ -24,6 +24,7 @@
 
 #include <memory>
 
+#include <comphelper/interfacecontainer3.hxx>
 #include <com/sun/star/embed/XOLESimpleStorage.hpp>
 #include <com/sun/star/lang/XServiceInfo.hpp>
 #include <cppuhelper/implbase.hxx>
@@ -35,7 +36,6 @@ namespace com::sun::star::io { class XInputStream; }
 namespace com::sun::star::io { class XStream; }
 namespace com::sun::star::lang { class XEventListener; }
 namespace com::sun::star::uno { class XComponentContext; }
-namespace comphelper { class OInterfaceContainerHelper2; }
 
 class BaseStorage;
 class SvStream;
@@ -51,7 +51,7 @@ class OLESimpleStorage : public 
cppu::WeakImplHelper<css::embed::XOLESimpleStora
     std::unique_ptr<SvStream> m_pStream;
     std::unique_ptr<BaseStorage> m_pStorage;
 
-    ::comphelper::OInterfaceContainerHelper2* m_pListenersContainer; // list 
of listeners
+    ::comphelper::OInterfaceContainerHelper3<css::lang::XEventListener>* 
m_pListenersContainer; // list of listeners
     css::uno::Reference<css::uno::XComponentContext> m_xContext;
 
     bool m_bNoTemporaryCopy;

Reply via email to