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

Arnaud Versini (via logerrit) logerrit at kemper.freedesktop.org
Thu May 20 10:03:17 UTC 2021


 shell/source/cmdmail/cmdmailmsg.cxx |   35 +++++++++++++++++------------------
 shell/source/cmdmail/cmdmailmsg.hxx |    3 ++-
 2 files changed, 19 insertions(+), 19 deletions(-)

New commits:
commit 7a4fffb19fb3d573d9afd3f7136cd0e5b545b706
Author:     Arnaud Versini <arnaud.versini at libreoffice.org>
AuthorDate: Sun Apr 18 16:28:49 2021 +0200
Commit:     Michael Stahl <michael.stahl at allotropia.de>
CommitDate: Thu May 20 12:02:32 2021 +0200

    shell : use std::mutex in CmdMailMsg
    
    Change-Id: I2aac780ce17e327a2f5ddbc835583bad1056bfc5
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114244
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.stahl at allotropia.de>

diff --git a/shell/source/cmdmail/cmdmailmsg.cxx b/shell/source/cmdmail/cmdmailmsg.cxx
index bd8657577b75..2a6a5f843af2 100644
--- a/shell/source/cmdmail/cmdmailmsg.cxx
+++ b/shell/source/cmdmail/cmdmailmsg.cxx
@@ -21,7 +21,6 @@
 
 using com::sun::star::container::NoSuchElementException;
 using com::sun::star::container::XNameAccess;
-using osl::MutexGuard;
 
 using namespace cppu;
 using namespace com::sun::star::uno;
@@ -29,91 +28,91 @@ using namespace com::sun::star::uno;
 
 void SAL_CALL CmdMailMsg::setBody( const OUString& aBody )
 {
-    MutexGuard aGuard( m_aMutex );
+    std::scoped_lock aGuard( m_aMutex );
     m_aBody = aBody;
 }
 
 OUString SAL_CALL CmdMailMsg::getBody(  )
 {
-    MutexGuard aGuard( m_aMutex );
+    std::scoped_lock aGuard( m_aMutex );
     return m_aBody;
 }
 
 void SAL_CALL CmdMailMsg::setRecipient( const OUString& aRecipient )
 {
-    MutexGuard aGuard( m_aMutex );
+    std::scoped_lock aGuard( m_aMutex );
     m_aRecipient = aRecipient;
 }
 
 OUString SAL_CALL CmdMailMsg::getRecipient(  )
 {
-    MutexGuard aGuard( m_aMutex );
+    std::scoped_lock aGuard( m_aMutex );
     return m_aRecipient;
 }
 
 void SAL_CALL CmdMailMsg::setCcRecipient( const Sequence< OUString >& aCcRecipient )
 {
-    MutexGuard aGuard( m_aMutex );
+    std::scoped_lock aGuard( m_aMutex );
     m_CcRecipients = aCcRecipient;
 }
 
 Sequence< OUString > SAL_CALL CmdMailMsg::getCcRecipient(  )
 {
-    MutexGuard aGuard( m_aMutex );
+    std::scoped_lock aGuard( m_aMutex );
     return m_CcRecipients;
 }
 
 void SAL_CALL CmdMailMsg::setBccRecipient( const Sequence< OUString >& aBccRecipient )
 {
-    MutexGuard aGuard( m_aMutex );
+    std::scoped_lock aGuard( m_aMutex );
     m_BccRecipients = aBccRecipient;
 }
 
 Sequence< OUString > SAL_CALL CmdMailMsg::getBccRecipient(  )
 {
-    MutexGuard aGuard( m_aMutex );
+    std::scoped_lock aGuard( m_aMutex );
     return m_BccRecipients;
 }
 
 void SAL_CALL CmdMailMsg::setOriginator( const OUString& aOriginator )
 {
-    MutexGuard aGuard( m_aMutex );
+    std::scoped_lock aGuard( m_aMutex );
     m_aOriginator = aOriginator;
 }
 
 OUString SAL_CALL CmdMailMsg::getOriginator(  )
 {
-    MutexGuard aGuard( m_aMutex );
+    std::scoped_lock aGuard( m_aMutex );
     return m_aOriginator;
 }
 
 void SAL_CALL CmdMailMsg::setSubject( const OUString& aSubject )
 {
-    MutexGuard aGuard( m_aMutex );
+    std::scoped_lock aGuard( m_aMutex );
     m_aSubject = aSubject;
 }
 
 OUString SAL_CALL CmdMailMsg::getSubject(  )
 {
-    MutexGuard aGuard( m_aMutex );
+    std::scoped_lock aGuard( m_aMutex );
     return m_aSubject;
 }
 
 void SAL_CALL CmdMailMsg::setAttachement( const Sequence< OUString >& aAttachment )
 {
-    MutexGuard aGuard( m_aMutex );
+    std::scoped_lock aGuard( m_aMutex );
     m_Attachments = aAttachment;
 }
 
 Sequence< OUString > SAL_CALL CmdMailMsg::getAttachement(  )
 {
-    MutexGuard aGuard( m_aMutex );
+    std::scoped_lock aGuard( m_aMutex );
     return m_Attachments;
 }
 
 Any SAL_CALL CmdMailMsg::getByName( const OUString& aName )
 {
-    MutexGuard aGuard( m_aMutex );
+    std::scoped_lock aGuard( m_aMutex );
 
     if( aName == "body" &&  !m_aBody.isEmpty() )
         return makeAny( m_aBody );
@@ -142,7 +141,7 @@ Any SAL_CALL CmdMailMsg::getByName( const OUString& aName )
 
 Sequence< OUString > SAL_CALL CmdMailMsg::getElementNames(  )
 {
-    MutexGuard aGuard( m_aMutex );
+    std::scoped_lock aGuard( m_aMutex );
 
     sal_Int32 nItems = 0;
     Sequence< OUString > aRet( 7 );
@@ -174,7 +173,7 @@ Sequence< OUString > SAL_CALL CmdMailMsg::getElementNames(  )
 
  sal_Bool SAL_CALL CmdMailMsg::hasByName( const OUString& aName )
 {
-    MutexGuard aGuard( m_aMutex );
+    std::scoped_lock aGuard( m_aMutex );
 
     if( aName == "body" &&  !m_aBody.isEmpty() )
         return true;
diff --git a/shell/source/cmdmail/cmdmailmsg.hxx b/shell/source/cmdmail/cmdmailmsg.hxx
index 43e40c1abf77..b481403953a5 100644
--- a/shell/source/cmdmail/cmdmailmsg.hxx
+++ b/shell/source/cmdmail/cmdmailmsg.hxx
@@ -20,6 +20,7 @@
 #ifndef INCLUDED_SHELL_SOURCE_CMDMAIL_CMDMAILMSG_HXX
 #define INCLUDED_SHELL_SOURCE_CMDMAIL_CMDMAILMSG_HXX
 
+#include <mutex>
 #include <cppuhelper/implbase.hxx>
 #include <com/sun/star/container/XNameAccess.hpp>
 
@@ -41,7 +42,7 @@ class CmdMailMsg :
     css::uno::Sequence< OUString >  m_BccRecipients;
     css::uno::Sequence< OUString >  m_Attachments;
 
-    ::osl::Mutex                    m_aMutex;
+    std::mutex                      m_aMutex;
 
 public:
 


More information about the Libreoffice-commits mailing list