chart2/source/controller/chartapiwrapper/UpDownBarWrapper.cxx |   10 ++++++----
 chart2/source/controller/chartapiwrapper/UpDownBarWrapper.hxx |    8 ++++----
 2 files changed, 10 insertions(+), 8 deletions(-)

New commits:
commit bd70713132fa92abcf7255ff151ffe8666948b40
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Thu Feb 23 11:04:22 2023 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Fri Feb 24 11:06:11 2023 +0000

    BaseMutex->std::mutex in UpDownBarWrapper
    
    Change-Id: I24a4400b3d223be76af135bd3da710490f029194
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147580
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/chart2/source/controller/chartapiwrapper/UpDownBarWrapper.cxx 
b/chart2/source/controller/chartapiwrapper/UpDownBarWrapper.cxx
index 6206878b2dbb..febfa344870b 100644
--- a/chart2/source/controller/chartapiwrapper/UpDownBarWrapper.cxx
+++ b/chart2/source/controller/chartapiwrapper/UpDownBarWrapper.cxx
@@ -126,7 +126,6 @@ namespace chart::wrapper
 UpDownBarWrapper::UpDownBarWrapper(
     bool bUp, std::shared_ptr<Chart2ModelContact> spChart2ModelContact)
         : m_spChart2ModelContact(std::move( spChart2ModelContact ))
-        , m_aEventListenerContainer( m_aMutex )
         , m_aPropertySetName( bUp ? OUString( "WhiteDay" ) : OUString( 
"BlackDay" ))
 {
 }
@@ -138,20 +137,23 @@ UpDownBarWrapper::~UpDownBarWrapper()
 // ____ XComponent ____
 void SAL_CALL UpDownBarWrapper::dispose()
 {
+    std::unique_lock g(m_aMutex);
     Reference< uno::XInterface > xSource( static_cast< ::cppu::OWeakObject* >( 
this ) );
-    m_aEventListenerContainer.disposeAndClear( lang::EventObject( xSource ) );
+    m_aEventListenerContainer.disposeAndClear( g, lang::EventObject( xSource ) 
);
 }
 
 void SAL_CALL UpDownBarWrapper::addEventListener(
     const Reference< lang::XEventListener >& xListener )
 {
-    m_aEventListenerContainer.addInterface( xListener );
+    std::unique_lock g(m_aMutex);
+    m_aEventListenerContainer.addInterface( g, xListener );
 }
 
 void SAL_CALL UpDownBarWrapper::removeEventListener(
     const Reference< lang::XEventListener >& aListener )
 {
-    m_aEventListenerContainer.removeInterface( aListener );
+    std::unique_lock g(m_aMutex);
+    m_aEventListenerContainer.removeInterface( g, aListener );
 }
 
 //XPropertySet
diff --git a/chart2/source/controller/chartapiwrapper/UpDownBarWrapper.hxx 
b/chart2/source/controller/chartapiwrapper/UpDownBarWrapper.hxx
index b1605a0f7282..740097fc3051 100644
--- a/chart2/source/controller/chartapiwrapper/UpDownBarWrapper.hxx
+++ b/chart2/source/controller/chartapiwrapper/UpDownBarWrapper.hxx
@@ -18,7 +18,7 @@
  */
 #pragma once
 
-#include <comphelper/interfacecontainer3.hxx>
+#include <comphelper/interfacecontainer4.hxx>
 
 #include <cppuhelper/basemutex.hxx>
 #include <cppuhelper/implbase.hxx>
@@ -36,8 +36,7 @@ namespace chart::wrapper
 
 class Chart2ModelContact;
 
-class UpDownBarWrapper : public cppu::BaseMutex
-                       , public ::cppu::WeakImplHelper
+class UpDownBarWrapper : public ::cppu::WeakImplHelper
                         < css::lang::XComponent
                         , css::lang::XServiceInfo
                         , css::beans::XPropertySet
@@ -94,8 +93,9 @@ public:
     virtual css::uno::Sequence< css::uno::Any > SAL_CALL getPropertyDefaults( 
const css::uno::Sequence< OUString >& aPropertyNames ) override;
 
 private: //member
+    std::mutex m_aMutex;
     std::shared_ptr< Chart2ModelContact >   m_spChart2ModelContact;
-    ::comphelper::OInterfaceContainerHelper3<css::lang::XEventListener> 
m_aEventListenerContainer;
+    ::comphelper::OInterfaceContainerHelper4<css::lang::XEventListener> 
m_aEventListenerContainer;
 
     OUString       m_aPropertySetName;
 };

Reply via email to