[Libreoffice-commits] core.git: include/unotools unotools/source

Noel Grandin (via logerrit) logerrit at kemper.freedesktop.org
Sat Jul 31 08:02:40 UTC 2021


 include/unotools/charclass.hxx     |    4 +--
 unotools/source/i18n/charclass.cxx |   40 ++++++++++++++++++-------------------
 2 files changed, 22 insertions(+), 22 deletions(-)

New commits:
commit c636f233fc0cd4f7c9000901fd006aa7823ade55
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Fri Jul 30 15:00:21 2021 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Sat Jul 31 10:02:06 2021 +0200

    osl::Mutex->std::mutex in CharClass
    
    Change-Id: I8f8873edbbc3974c38fe51ea1c65f93c22570891
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119713
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/include/unotools/charclass.hxx b/include/unotools/charclass.hxx
index 61a850da9570..521f3abe003b 100644
--- a/include/unotools/charclass.hxx
+++ b/include/unotools/charclass.hxx
@@ -26,8 +26,8 @@
 #include <com/sun/star/i18n/KCharacterType.hpp>
 #include <com/sun/star/i18n/ParseResult.hpp>
 #include <com/sun/star/i18n/UnicodeScript.hpp>
-#include <osl/mutex.hxx>
 #include <com/sun/star/uno/Reference.hxx>
+#include <mutex>
 
 namespace com::sun::star::uno { class XComponentContext; }
 namespace com::sun::star::i18n { class XCharacterClassification; }
@@ -62,7 +62,7 @@ class UNOTOOLS_DLLPUBLIC CharClass
 {
     LanguageTag                 maLanguageTag;
     css::uno::Reference< css::i18n::XCharacterClassification >    xCC;
-    mutable ::osl::Mutex        aMutex;
+    mutable std::mutex        aMutex;
 
     CharClass(const CharClass&) = delete;
     CharClass& operator=(const CharClass&) = delete;
diff --git a/unotools/source/i18n/charclass.cxx b/unotools/source/i18n/charclass.cxx
index 394ed81c2936..7c1c2b92d4c4 100644
--- a/unotools/source/i18n/charclass.cxx
+++ b/unotools/source/i18n/charclass.cxx
@@ -53,13 +53,13 @@ CharClass::~CharClass()
 
 void CharClass::setLanguageTag( const LanguageTag& rLanguageTag )
 {
-    ::osl::MutexGuard aGuard( aMutex );
+    std::lock_guard aGuard( aMutex );
     maLanguageTag = rLanguageTag;
 }
 
 const LanguageTag& CharClass::getLanguageTag() const
 {
-    ::osl::MutexGuard aGuard( aMutex );
+    std::lock_guard aGuard( aMutex );
     return maLanguageTag;
 }
 
@@ -115,7 +115,7 @@ bool CharClass::isAlpha( const OUString& rStr, sal_Int32 nPos ) const
     {
         if ( xCC.is() )
         {
-            ::osl::MutexGuard aGuard( aMutex );
+            std::lock_guard aGuard( aMutex );
             return  (xCC->getCharacterType( rStr, nPos, getMyLocale() ) &
                      nCharClassAlphaType) != 0;
         }
@@ -137,7 +137,7 @@ bool CharClass::isLetter( const OUString& rStr, sal_Int32 nPos ) const
     {
         if ( xCC.is() )
         {
-            ::osl::MutexGuard aGuard( aMutex );
+            std::lock_guard aGuard( aMutex );
             return  (xCC->getCharacterType( rStr, nPos, getMyLocale() ) &
                      nCharClassLetterType) != 0;
         }
@@ -155,7 +155,7 @@ bool CharClass::isLetter( const OUString& rStr ) const
     {
         if ( xCC.is() )
         {
-            ::osl::MutexGuard aGuard( aMutex );
+            std::lock_guard aGuard( aMutex );
             return isLetterType( xCC->getStringType( rStr, 0, rStr.getLength(), getMyLocale() ) );
         }
     }
@@ -176,7 +176,7 @@ bool CharClass::isDigit( const OUString& rStr, sal_Int32 nPos ) const
     {
         if ( xCC.is() )
         {
-            ::osl::MutexGuard aGuard( aMutex );
+            std::lock_guard aGuard( aMutex );
             return  (xCC->getCharacterType( rStr, nPos, getMyLocale() ) &
                      KCharacterType::DIGIT) != 0;
         }
@@ -194,7 +194,7 @@ bool CharClass::isNumeric( const OUString& rStr ) const
     {
         if ( xCC.is() )
         {
-            ::osl::MutexGuard aGuard( aMutex );
+            std::lock_guard aGuard( aMutex );
             return isNumericType( xCC->getStringType( rStr, 0, rStr.getLength(), getMyLocale() ) );
         }
     }
@@ -215,7 +215,7 @@ bool CharClass::isAlphaNumeric( const OUString& rStr, sal_Int32 nPos ) const
     {
         if ( xCC.is() )
         {
-            ::osl::MutexGuard aGuard( aMutex );
+            std::lock_guard aGuard( aMutex );
             return  (xCC->getCharacterType( rStr, nPos, getMyLocale() ) &
                 (nCharClassAlphaType | KCharacterType::DIGIT)) != 0;
         }
@@ -237,7 +237,7 @@ bool CharClass::isLetterNumeric( const OUString& rStr, sal_Int32 nPos ) const
     {
         if ( xCC.is() )
         {
-            ::osl::MutexGuard aGuard( aMutex );
+            std::lock_guard aGuard( aMutex );
             return  (xCC->getCharacterType( rStr, nPos, getMyLocale() ) &
                      (nCharClassLetterType | KCharacterType::DIGIT)) != 0;
         }
@@ -255,7 +255,7 @@ bool CharClass::isLetterNumeric( const OUString& rStr ) const
     {
         if ( xCC.is() )
         {
-            ::osl::MutexGuard aGuard( aMutex );
+            std::lock_guard aGuard( aMutex );
             return isLetterNumericType( xCC->getStringType( rStr, 0, rStr.getLength(), getMyLocale() ) );
         }
     }
@@ -272,7 +272,7 @@ OUString CharClass::titlecase(const OUString& rStr, sal_Int32 nPos, sal_Int32 nC
     {
         if ( xCC.is() )
         {
-            ::osl::MutexGuard aGuard( aMutex );
+            std::lock_guard aGuard( aMutex );
             return xCC->toTitle( rStr, nPos, nCount, getMyLocale() );
         }
     }
@@ -289,7 +289,7 @@ OUString CharClass::uppercase( const OUString& rStr, sal_Int32 nPos, sal_Int32 n
     {
         if ( xCC.is() )
         {
-            ::osl::MutexGuard aGuard( aMutex );
+            std::lock_guard aGuard( aMutex );
             return xCC->toUpper( rStr, nPos, nCount, getMyLocale() );
         }
     }
@@ -306,7 +306,7 @@ OUString CharClass::lowercase( const OUString& rStr, sal_Int32 nPos, sal_Int32 n
     {
         if ( xCC.is() )
         {
-            ::osl::MutexGuard aGuard( aMutex );
+            std::lock_guard aGuard( aMutex );
             return xCC->toLower( rStr, nPos, nCount, getMyLocale() );
         }
     }
@@ -323,7 +323,7 @@ sal_Int16 CharClass::getType( const OUString& rStr, sal_Int32 nPos ) const
     {
         if ( xCC.is() )
         {
-            ::osl::MutexGuard aGuard( aMutex );
+            std::lock_guard aGuard( aMutex );
             return xCC->getType( rStr, nPos );
         }
     }
@@ -340,7 +340,7 @@ css::i18n::DirectionProperty CharClass::getCharacterDirection( const OUString& r
     {
         if ( xCC.is() )
         {
-            ::osl::MutexGuard aGuard( aMutex );
+            std::lock_guard aGuard( aMutex );
             return static_cast<css::i18n::DirectionProperty>(xCC->getCharacterDirection( rStr, nPos ));
         }
     }
@@ -357,7 +357,7 @@ css::i18n::UnicodeScript CharClass::getScript( const OUString& rStr, sal_Int32 n
     {
         if ( xCC.is() )
         {
-            ::osl::MutexGuard aGuard( aMutex );
+            std::lock_guard aGuard( aMutex );
             return static_cast<css::i18n::UnicodeScript>(xCC->getScript( rStr, nPos ));
         }
     }
@@ -374,7 +374,7 @@ sal_Int32 CharClass::getCharacterType( const OUString& rStr, sal_Int32 nPos ) co
     {
         if ( xCC.is() )
         {
-            ::osl::MutexGuard aGuard( aMutex );
+            std::lock_guard aGuard( aMutex );
             return xCC->getCharacterType( rStr, nPos, getMyLocale() );
         }
     }
@@ -391,7 +391,7 @@ sal_Int32 CharClass::getStringType( const OUString& rStr, sal_Int32 nPos, sal_In
     {
         if ( xCC.is() )
         {
-            ::osl::MutexGuard aGuard( aMutex );
+            std::lock_guard aGuard( aMutex );
             return xCC->getStringType( rStr, nPos, nCount, getMyLocale() );
         }
     }
@@ -414,7 +414,7 @@ css::i18n::ParseResult CharClass::parseAnyToken(
     {
         if ( xCC.is() )
         {
-            ::osl::MutexGuard aGuard( aMutex );
+            std::lock_guard aGuard( aMutex );
             return xCC->parseAnyToken( rStr, nPos, getMyLocale(),
                 nStartCharFlags, userDefinedCharactersStart,
                 nContCharFlags, userDefinedCharactersCont );
@@ -440,7 +440,7 @@ css::i18n::ParseResult CharClass::parsePredefinedToken(
     {
         if ( xCC.is() )
         {
-            ::osl::MutexGuard aGuard( aMutex );
+            std::lock_guard aGuard( aMutex );
             return xCC->parsePredefinedToken( nTokenType, rStr, nPos, getMyLocale(),
                 nStartCharFlags, userDefinedCharactersStart,
                 nContCharFlags, userDefinedCharactersCont );


More information about the Libreoffice-commits mailing list