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

Noel Grandin (via logerrit) logerrit at kemper.freedesktop.org
Sat Jul 31 20:00:03 UTC 2021


 unoxml/source/dom/documentbuilder.cxx |   12 ++++++------
 unoxml/source/dom/documentbuilder.hxx |    3 ++-
 2 files changed, 8 insertions(+), 7 deletions(-)

New commits:
commit e66fdb597b30fc701bb068824d0ae4d89fecd55f
Author:     Noel Grandin <noelgrandin at gmail.com>
AuthorDate: Sat Jul 31 20:12:30 2021 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Sat Jul 31 21:59:29 2021 +0200

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

diff --git a/unoxml/source/dom/documentbuilder.cxx b/unoxml/source/dom/documentbuilder.cxx
index 8d42ad5f9b75..b40a7347ea08 100644
--- a/unoxml/source/dom/documentbuilder.cxx
+++ b/unoxml/source/dom/documentbuilder.cxx
@@ -129,7 +129,7 @@ namespace DOM
 
     Reference< XDocument > SAL_CALL CDocumentBuilder::newDocument()
     {
-        ::osl::MutexGuard const g(m_Mutex);
+        std::lock_guard const g(m_Mutex);
 
         // create a new document
         xmlDocPtr pDocument = xmlNewDoc(reinterpret_cast<const xmlChar*>("1.0"));
@@ -333,7 +333,7 @@ namespace DOM
             throw RuntimeException();
         }
 
-        ::osl::MutexGuard const g(m_Mutex);
+        std::lock_guard const g(m_Mutex);
 
         // IO context struct.  Must outlive pContext, as destroying that via
         // xmlFreeParserCtxt may still access this context_t
@@ -364,7 +364,7 @@ namespace DOM
 
     Reference< XDocument > SAL_CALL CDocumentBuilder::parseURI(const OUString& sUri)
     {
-        ::osl::MutexGuard const g(m_Mutex);
+        std::lock_guard const g(m_Mutex);
 
         std::unique_ptr<xmlParserCtxt, XmlFreeParserCtxt> const pContext(
                 xmlNewParserCtxt());
@@ -403,14 +403,14 @@ namespace DOM
     void SAL_CALL
     CDocumentBuilder::setEntityResolver(Reference< XEntityResolver > const& xER)
     {
-        ::osl::MutexGuard const g(m_Mutex);
+        std::lock_guard const g(m_Mutex);
 
         m_xEntityResolver = xER;
     }
 
     Reference< XEntityResolver > CDocumentBuilder::getEntityResolver()
     {
-        ::osl::MutexGuard const g(m_Mutex);
+        std::lock_guard const g(m_Mutex);
 
         return m_xEntityResolver;
     }
@@ -418,7 +418,7 @@ namespace DOM
     void SAL_CALL
     CDocumentBuilder::setErrorHandler(Reference< XErrorHandler > const& xEH)
     {
-        ::osl::MutexGuard const g(m_Mutex);
+        std::lock_guard const g(m_Mutex);
 
         m_xErrorHandler = xEH;
     }
diff --git a/unoxml/source/dom/documentbuilder.hxx b/unoxml/source/dom/documentbuilder.hxx
index 40edc4525979..4e3d123094f5 100644
--- a/unoxml/source/dom/documentbuilder.hxx
+++ b/unoxml/source/dom/documentbuilder.hxx
@@ -35,6 +35,7 @@
 #include <com/sun/star/io/XInputStream.hpp>
 #include <com/sun/star/lang/XServiceInfo.hpp>
 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <mutex>
 
 namespace DOM
 {
@@ -47,7 +48,7 @@ namespace DOM
         : public CDocumentBuilder_Base
     {
     private:
-        ::osl::Mutex m_Mutex;
+        std::mutex m_Mutex;
         css::uno::Reference< css::xml::sax::XEntityResolver > m_xEntityResolver;
         css::uno::Reference< css::xml::sax::XErrorHandler > m_xErrorHandler;
 


More information about the Libreoffice-commits mailing list