From 4799ee69d7193fcb1e8c105ef6c8b4ddc5e6721b Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Sun, 18 Jul 2021 11:41:45 +0200 Subject: osl::Mutex->std::mutex in NumberFormatCodeMapper Change-Id: I79d95ca1e5aa29d0a416d8870430062fd2b9936a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119130 Tested-by: Jenkins Reviewed-by: Noel Grandin --- i18npool/inc/numberformatcode.hxx | 3 ++- i18npool/source/numberformatcode/numberformatcode.cxx | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/i18npool/inc/numberformatcode.hxx b/i18npool/inc/numberformatcode.hxx index 2b1a5006653d..d51abd7de74b 100644 --- a/i18npool/inc/numberformatcode.hxx +++ b/i18npool/inc/numberformatcode.hxx @@ -27,6 +27,7 @@ #include #include +#include #include namespace com::sun::star::i18n { class XLocaleData5; } @@ -55,7 +56,7 @@ public: virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override; private: - osl::Mutex maMutex; + std::mutex maMutex; css::uno::Reference < css::i18n::XLocaleData5 > m_xLocaleData; typedef std::pair< css::lang::Locale, css::uno::Sequence< css::i18n::FormatElement > > FormatElementCacheItem; std::deque < FormatElementCacheItem > m_aFormatElementCache; diff --git a/i18npool/source/numberformatcode/numberformatcode.cxx b/i18npool/source/numberformatcode/numberformatcode.cxx index 90d6904b85a1..0e76f087b02f 100644 --- a/i18npool/source/numberformatcode/numberformatcode.cxx +++ b/i18npool/source/numberformatcode/numberformatcode.cxx @@ -43,7 +43,7 @@ NumberFormatCodeMapper::getDefault( sal_Int16 formatType, sal_Int16 formatUsage, OUString elementType = mapElementTypeShortToString(formatType); OUString elementUsage = mapElementUsageShortToString(formatUsage); - osl::MutexGuard g(maMutex); + std::lock_guard g(maMutex); const css::uno::Sequence< css::i18n::FormatElement > &aFormatSeq = getFormats( rLocale ); auto pFormat = std::find_if(aFormatSeq.begin(), aFormatSeq.end(), @@ -67,7 +67,7 @@ NumberFormatCodeMapper::getDefault( sal_Int16 formatType, sal_Int16 formatUsage, css::i18n::NumberFormatCode SAL_CALL NumberFormatCodeMapper::getFormatCode( sal_Int16 formatIndex, const css::lang::Locale& rLocale ) { - osl::MutexGuard g(maMutex); + std::lock_guard g(maMutex); const css::uno::Sequence< css::i18n::FormatElement > &aFormatSeq = getFormats( rLocale ); auto pFormat = std::find_if(aFormatSeq.begin(), aFormatSeq.end(), @@ -88,7 +88,7 @@ NumberFormatCodeMapper::getFormatCode( sal_Int16 formatIndex, const css::lang::L css::uno::Sequence< css::i18n::NumberFormatCode > SAL_CALL NumberFormatCodeMapper::getAllFormatCode( sal_Int16 formatUsage, const css::lang::Locale& rLocale ) { - osl::MutexGuard g(maMutex); + std::lock_guard g(maMutex); const css::uno::Sequence< css::i18n::FormatElement > &aFormatSeq = getFormats( rLocale ); std::vector aVec; @@ -113,7 +113,7 @@ NumberFormatCodeMapper::getAllFormatCode( sal_Int16 formatUsage, const css::lang css::uno::Sequence< css::i18n::NumberFormatCode > SAL_CALL NumberFormatCodeMapper::getAllFormatCodes( const css::lang::Locale& rLocale ) { - osl::MutexGuard g(maMutex); + std::lock_guard g(maMutex); const css::uno::Sequence< css::i18n::FormatElement > &aFormatSeq = getFormats( rLocale ); std::vector aVec; -- cgit