[Libreoffice-commits] core.git: i18npool/inc i18npool/source

Noel Grandin (via logerrit) logerrit at kemper.freedesktop.org
Sun Jul 18 18:48:15 UTC 2021


 i18npool/inc/numberformatcode.hxx                     |    3 ++-
 i18npool/source/numberformatcode/numberformatcode.cxx |    8 ++++----
 2 files changed, 6 insertions(+), 5 deletions(-)

New commits:
commit 4799ee69d7193fcb1e8c105ef6c8b4ddc5e6721b
Author:     Noel Grandin <noelgrandin at gmail.com>
AuthorDate: Sun Jul 18 11:41:45 2021 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Sun Jul 18 20:47:42 2021 +0200

    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 at collabora.co.uk>

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;


More information about the Libreoffice-commits mailing list