summaryrefslogtreecommitdiff
path: root/basic
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2021-12-17 18:57:03 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-12-18 19:49:38 +0100
commitfcba66fa86a77a3ca86705a4f145f8aae198ff87 (patch)
tree466a95475b407b24383e20040b12443a599e94e1 /basic
parentde9fa7b24c14473ce97fac2edc124093e5a17814 (diff)
osl::Mutex->std::mutex in ModuleInvocationProxy
Change-Id: I2ec935fb1c53338f475d5e8aec877f84824a56e9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127074 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'basic')
-rw-r--r--basic/source/classes/sbunoobj.cxx13
1 files changed, 7 insertions, 6 deletions
diff --git a/basic/source/classes/sbunoobj.cxx b/basic/source/classes/sbunoobj.cxx
index 9e1d31fb4ac1..362ea2d42898 100644
--- a/basic/source/classes/sbunoobj.cxx
+++ b/basic/source/classes/sbunoobj.cxx
@@ -27,7 +27,7 @@
#include <cppuhelper/implbase.hxx>
#include <cppuhelper/exc_hlp.hxx>
-#include <comphelper/interfacecontainer2.hxx>
+#include <comphelper/interfacecontainer4.hxx>
#include <comphelper/extract.hxx>
#include <comphelper/processfactory.hxx>
#include <cppuhelper/weakref.hxx>
@@ -4166,12 +4166,12 @@ namespace {
class ModuleInvocationProxy : public WeakImplHelper< XInvocation, XComponent >
{
- ::osl::Mutex m_aMutex;
+ std::mutex m_aMutex;
OUString m_aPrefix;
SbxObjectRef m_xScopeObj;
bool m_bProxyIsClassModuleObject;
- ::comphelper::OInterfaceContainerHelper2 m_aListeners;
+ ::comphelper::OInterfaceContainerHelper4<XEventListener> m_aListeners;
public:
ModuleInvocationProxy( std::u16string_view aPrefix, SbxObjectRef const & xScopeObj );
@@ -4199,7 +4199,6 @@ public:
ModuleInvocationProxy::ModuleInvocationProxy( std::u16string_view aPrefix, SbxObjectRef const & xScopeObj )
: m_aPrefix( OUString::Concat(aPrefix) + "_" )
, m_xScopeObj( xScopeObj )
- , m_aListeners( m_aMutex )
{
m_bProxyIsClassModuleObject = xScopeObj.is() && dynamic_cast<const SbClassModuleObject*>( xScopeObj.get() ) != nullptr;
}
@@ -4355,21 +4354,23 @@ Any SAL_CALL ModuleInvocationProxy::invoke( const OUString& rFunction,
void SAL_CALL ModuleInvocationProxy::dispose()
{
- ::osl::MutexGuard aGuard( m_aMutex );
+ std::unique_lock aGuard( m_aMutex );
EventObject aEvent( static_cast<XComponent*>(this) );
- m_aListeners.disposeAndClear( aEvent );
+ m_aListeners.disposeAndClear( aGuard, aEvent );
m_xScopeObj = nullptr;
}
void SAL_CALL ModuleInvocationProxy::addEventListener( const Reference< XEventListener >& xListener )
{
+ std::unique_lock aGuard( m_aMutex );
m_aListeners.addInterface( xListener );
}
void SAL_CALL ModuleInvocationProxy::removeEventListener( const Reference< XEventListener >& xListener )
{
+ std::unique_lock aGuard( m_aMutex );
m_aListeners.removeInterface( xListener );
}