[Libreoffice-commits] core.git: stoc/source

Noel Grandin (via logerrit) logerrit at kemper.freedesktop.org
Tue Aug 3 11:21:41 UTC 2021


 stoc/source/uriproc/UriReference.cxx                              |   30 +++++-----
 stoc/source/uriproc/UriReference.hxx                              |    4 -
 stoc/source/uriproc/UriSchemeParser_vndDOTsunDOTstarDOTscript.cxx |   10 +--
 3 files changed, 22 insertions(+), 22 deletions(-)

New commits:
commit 5891746d5cf459ea87ad79ea231f2aedaafb7b39
Author:     Noel Grandin <noelgrandin at gmail.com>
AuthorDate: Sun Aug 1 19:09:07 2021 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Tue Aug 3 13:21:07 2021 +0200

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

diff --git a/stoc/source/uriproc/UriReference.cxx b/stoc/source/uriproc/UriReference.cxx
index 75ed1abaa2a4..b5962ea74342 100644
--- a/stoc/source/uriproc/UriReference.cxx
+++ b/stoc/source/uriproc/UriReference.cxx
@@ -50,7 +50,7 @@ UriReference::~UriReference() {}
 
 OUString UriReference::getUriReference()
 {
-    osl::MutexGuard g(m_mutex);
+    std::lock_guard g(m_mutex);
     OUStringBuffer buf(128);
     if (!m_scheme.isEmpty()) {
         buf.append(m_scheme);
@@ -71,41 +71,41 @@ bool UriReference::isAbsolute() const {
 
 OUString UriReference::getSchemeSpecificPart()
 {
-    osl::MutexGuard g(m_mutex);
+    std::lock_guard g(m_mutex);
     OUStringBuffer buf;
     appendSchemeSpecificPart(buf);
     return buf.makeStringAndClear();
 }
 
 bool UriReference::isHierarchical() {
-    osl::MutexGuard g(m_mutex);
+    std::lock_guard g(m_mutex);
     return m_scheme.isEmpty() || m_hasAuthority || m_path.startsWith("/");
 }
 
 bool UriReference::hasAuthority() {
-    osl::MutexGuard g(m_mutex);
+    std::lock_guard g(m_mutex);
     return m_hasAuthority;
 }
 
 OUString UriReference::getAuthority() {
-    osl::MutexGuard g(m_mutex);
+    std::lock_guard g(m_mutex);
     return m_authority;
 }
 
 OUString UriReference::getPath() {
-    osl::MutexGuard g(m_mutex);
+    std::lock_guard g(m_mutex);
     return m_path;
 }
 
 bool UriReference::hasRelativePath() {
-    osl::MutexGuard g(m_mutex);
+    std::lock_guard g(m_mutex);
     return !m_hasAuthority
         && (m_path.isEmpty() || m_path[0] != '/');
 }
 
 sal_Int32 UriReference::getPathSegmentCount()
 {
-    osl::MutexGuard g(m_mutex);
+    std::lock_guard g(m_mutex);
     if (m_path.isEmpty()) {
         return 0;
     } else {
@@ -123,7 +123,7 @@ sal_Int32 UriReference::getPathSegmentCount()
 
 OUString UriReference::getPathSegment(sal_Int32 index)
 {
-    osl::MutexGuard g(m_mutex);
+    std::lock_guard g(m_mutex);
     if (!m_path.isEmpty() && index >= 0) {
         for (sal_Int32 i = m_path[0] == '/' ? 1 : 0;; ++i) {
             if (index-- == 0) {
@@ -140,34 +140,34 @@ OUString UriReference::getPathSegment(sal_Int32 index)
 }
 
 bool UriReference::hasQuery() {
-    osl::MutexGuard g(m_mutex);
+    std::lock_guard g(m_mutex);
     return m_hasQuery;
 }
 
 OUString UriReference::getQuery() {
-    osl::MutexGuard g(m_mutex);
+    std::lock_guard g(m_mutex);
     return m_query;
 }
 
 bool UriReference::hasFragment() {
-    osl::MutexGuard g(m_mutex);
+    std::lock_guard g(m_mutex);
     return m_hasFragment;
 }
 
 OUString UriReference::getFragment() {
-    osl::MutexGuard g(m_mutex);
+    std::lock_guard g(m_mutex);
     return m_fragment;
 }
 
 void UriReference::setFragment(OUString const & fragment)
 {
-    osl::MutexGuard g(m_mutex);
+    std::lock_guard g(m_mutex);
     m_hasFragment = true;
     m_fragment = fragment;
 }
 
 void UriReference::clearFragment() {
-    osl::MutexGuard g(m_mutex);
+    std::lock_guard g(m_mutex);
     m_hasFragment = false;
     m_fragment.clear();
 }
diff --git a/stoc/source/uriproc/UriReference.hxx b/stoc/source/uriproc/UriReference.hxx
index 4a88c414f567..90a095873364 100644
--- a/stoc/source/uriproc/UriReference.hxx
+++ b/stoc/source/uriproc/UriReference.hxx
@@ -20,7 +20,7 @@
 #ifndef INCLUDED_STOC_SOURCE_URIPROC_URIREFERENCE_HXX
 #define INCLUDED_STOC_SOURCE_URIPROC_URIREFERENCE_HXX
 
-#include <osl/mutex.hxx>
+#include <mutex>
 #include <rtl/ustring.hxx>
 #include <sal/types.h>
 #include <rtl/ustrbuf.hxx>
@@ -87,7 +87,7 @@ public:
     /// @throws css::uno::RuntimeException
     void clearFragment();
 
-    osl::Mutex m_mutex;
+    std::mutex m_mutex;
     OUString m_scheme;
     OUString m_authority;
     OUString m_path;
diff --git a/stoc/source/uriproc/UriSchemeParser_vndDOTsunDOTstarDOTscript.cxx b/stoc/source/uriproc/UriSchemeParser_vndDOTsunDOTstarDOTscript.cxx
index d5cfb2347863..1614f44b2f89 100644
--- a/stoc/source/uriproc/UriSchemeParser_vndDOTsunDOTstarDOTscript.cxx
+++ b/stoc/source/uriproc/UriSchemeParser_vndDOTsunDOTstarDOTscript.cxx
@@ -267,7 +267,7 @@ private:
 };
 
 OUString UrlReference::getName() {
-    osl::MutexGuard g(m_base.m_mutex);
+    std::lock_guard g(m_base.m_mutex);
     sal_Int32 i = 0;
     return parsePart(m_base.m_path, true, &i);
 }
@@ -278,7 +278,7 @@ void SAL_CALL UrlReference::setName(OUString const & name)
         throw css::lang::IllegalArgumentException(
             OUString(), *this, 1);
 
-    osl::MutexGuard g(m_base.m_mutex);
+    std::lock_guard g(m_base.m_mutex);
     sal_Int32 i = 0;
     parsePart(m_base.m_path, true, &i);
 
@@ -287,13 +287,13 @@ void SAL_CALL UrlReference::setName(OUString const & name)
 
 sal_Bool UrlReference::hasParameter(OUString const & key)
 {
-    osl::MutexGuard g(m_base.m_mutex);
+    std::lock_guard g(m_base.m_mutex);
     return findParameter(key) >= 0;
 }
 
 OUString UrlReference::getParameter(OUString const & key)
 {
-    osl::MutexGuard g(m_base.m_mutex);
+    std::lock_guard g(m_base.m_mutex);
     sal_Int32 i = findParameter(key);
     return i >= 0 ? parsePart(m_base.m_path, false, &i) : OUString();
 }
@@ -304,7 +304,7 @@ void UrlReference::setParameter(OUString const & key, OUString const & value)
         throw css::lang::IllegalArgumentException(
             OUString(), *this, 1);
 
-    osl::MutexGuard g(m_base.m_mutex);
+    std::lock_guard g(m_base.m_mutex);
     sal_Int32 i = findParameter(key);
     bool bExistent = ( i>=0 );
     if (!bExistent) {


More information about the Libreoffice-commits mailing list