summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2021-12-21 17:03:24 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-01-02 07:16:07 +0100
commitdbdfdb74b42b32bd8428acdffac20fe63599a67d (patch)
treed2be637072313a632a835d7726ac185e5ff5dbc0 /svx
parenta3adb6f82eb582f5bc52037018ad3b7b53bb4bd1 (diff)
osl::Mutex->std::mutex in ChineseTranslation_UnoDialog
Change-Id: Ife56a3d106f64b00b63798d6300e768bbfa81335 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127833 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svx')
-rw-r--r--svx/source/unodialogs/textconversiondlgs/chinese_translation_unodialog.cxx7
-rw-r--r--svx/source/unodialogs/textconversiondlgs/chinese_translation_unodialog.hxx7
2 files changed, 8 insertions, 6 deletions
diff --git a/svx/source/unodialogs/textconversiondlgs/chinese_translation_unodialog.cxx b/svx/source/unodialogs/textconversiondlgs/chinese_translation_unodialog.cxx
index 23635fbc8b94..80cda9bb6555 100644
--- a/svx/source/unodialogs/textconversiondlgs/chinese_translation_unodialog.cxx
+++ b/svx/source/unodialogs/textconversiondlgs/chinese_translation_unodialog.cxx
@@ -32,7 +32,6 @@ using namespace ::com::sun::star;
ChineseTranslation_UnoDialog::ChineseTranslation_UnoDialog()
: m_bDisposed(false)
, m_bInDispose(false)
- , m_aDisposeEventListeners(m_aContainerMutex)
{
}
@@ -125,8 +124,8 @@ void SAL_CALL ChineseTranslation_UnoDialog::dispose()
aEvt.Source = static_cast< XComponent * >( this );
}
- if( m_aDisposeEventListeners.getLength() )
- m_aDisposeEventListeners.disposeAndClear( aEvt );
+ std::unique_lock aGuard(m_aContainerMutex);
+ m_aDisposeEventListeners.disposeAndClear( aGuard, aEvt );
}
void SAL_CALL ChineseTranslation_UnoDialog::addEventListener( const uno::Reference< lang::XEventListener > & xListener )
@@ -134,6 +133,7 @@ void SAL_CALL ChineseTranslation_UnoDialog::addEventListener( const uno::Referen
SolarMutexGuard aSolarGuard;
if( m_bDisposed || m_bInDispose )
return;
+ std::unique_lock aGuard(m_aContainerMutex);
m_aDisposeEventListeners.addInterface( xListener );
}
@@ -142,6 +142,7 @@ void SAL_CALL ChineseTranslation_UnoDialog::removeEventListener( const uno::Refe
SolarMutexGuard aSolarGuard;
if( m_bDisposed || m_bInDispose )
return;
+ std::unique_lock aGuard(m_aContainerMutex);
m_aDisposeEventListeners.removeInterface( xListener );
}
diff --git a/svx/source/unodialogs/textconversiondlgs/chinese_translation_unodialog.hxx b/svx/source/unodialogs/textconversiondlgs/chinese_translation_unodialog.hxx
index a0faff6c9852..0d40e1227ef5 100644
--- a/svx/source/unodialogs/textconversiondlgs/chinese_translation_unodialog.hxx
+++ b/svx/source/unodialogs/textconversiondlgs/chinese_translation_unodialog.hxx
@@ -29,7 +29,8 @@
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/ui/dialogs/XExecutableDialog.hpp>
#include <cppuhelper/implbase.hxx>
-#include <comphelper/interfacecontainer3.hxx>
+#include <comphelper/interfacecontainer4.hxx>
+#include <mutex>
namespace textconversiondlgs
@@ -108,8 +109,8 @@ private:
bool m_bDisposed; ///Dispose call ready.
bool m_bInDispose;///In dispose call
- osl::Mutex m_aContainerMutex;
- comphelper::OInterfaceContainerHelper3<css::lang::XEventListener> m_aDisposeEventListeners;
+ std::mutex m_aContainerMutex;
+ comphelper::OInterfaceContainerHelper4<css::lang::XEventListener> m_aDisposeEventListeners;
};