diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2021-07-18 11:41:45 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-07-18 20:47:42 +0200 |
commit | 4799ee69d7193fcb1e8c105ef6c8b4ddc5e6721b (patch) | |
tree | 5ea883d5d2d13819ee552688d7ae8273c5e5d887 | |
parent | 2b9afb52a96b86cb6f1aab2bdccca3b19566a8c7 (diff) |
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 <noel.grandin@collabora.co.uk>
-rw-r--r-- | i18npool/inc/numberformatcode.hxx | 3 | ||||
-rw-r--r-- | 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 <com/sun/star/lang/XServiceInfo.hpp> #include <deque> +#include <mutex> #include <utility> 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<css::i18n::NumberFormatCode> 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<css::i18n::NumberFormatCode> aVec; |