summaryrefslogtreecommitdiff
path: root/unoxml
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2021-12-23 21:38:41 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-12-25 07:15:33 +0100
commit870a3b5bc34d5d4082b46940822d871106cac2d9 (patch)
tree7c7b8a5b56e0a585f63e333b0888157690bede52 /unoxml
parent8d17c555ad913b787927ab327586965c04048505 (diff)
osl::Mutex->std::mutex in CEvent
Change-Id: I644ebf86803448e824818f571d6612741408d02c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127402 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'unoxml')
-rw-r--r--unoxml/inc/event.hxx3
-rw-r--r--unoxml/source/events/event.cxx18
-rw-r--r--unoxml/source/events/mouseevent.cxx21
-rw-r--r--unoxml/source/events/mutationevent.cxx15
-rw-r--r--unoxml/source/events/uievent.cxx7
5 files changed, 32 insertions, 32 deletions
diff --git a/unoxml/inc/event.hxx b/unoxml/inc/event.hxx
index c33d8f9d3b3c..216bf2775ed4 100644
--- a/unoxml/inc/event.hxx
+++ b/unoxml/inc/event.hxx
@@ -27,6 +27,7 @@
#include <com/sun/star/util/Time.hpp>
#include <cppuhelper/implbase.hxx>
+#include <mutex>
namespace DOM::events
{
@@ -35,7 +36,7 @@ class CEvent : public cppu::WeakImplHelper< css::xml::dom::events::XEvent >
friend class CEventDispatcher;
protected:
- ::osl::Mutex m_Mutex;
+ std::mutex m_Mutex;
bool m_canceled;
OUString m_eventType;
css::uno::Reference< css::xml::dom::events::XEventTarget > m_target;
diff --git a/unoxml/source/events/event.cxx b/unoxml/source/events/event.cxx
index bc12bb5f83c1..e3b092ff3831 100644
--- a/unoxml/source/events/event.cxx
+++ b/unoxml/source/events/event.cxx
@@ -39,52 +39,52 @@ namespace DOM::events
OUString SAL_CALL CEvent::getType()
{
- ::osl::MutexGuard const g(m_Mutex);
+ std::unique_lock const g(m_Mutex);
return m_eventType;
}
Reference< XEventTarget > SAL_CALL
CEvent::getTarget()
{
- ::osl::MutexGuard const g(m_Mutex);
+ std::unique_lock const g(m_Mutex);
return m_target;
}
Reference< XEventTarget > SAL_CALL
CEvent::getCurrentTarget()
{
- ::osl::MutexGuard const g(m_Mutex);
+ std::unique_lock const g(m_Mutex);
return m_currentTarget;
}
PhaseType SAL_CALL CEvent::getEventPhase()
{
- ::osl::MutexGuard const g(m_Mutex);
+ std::unique_lock const g(m_Mutex);
return m_phase;
}
sal_Bool SAL_CALL CEvent::getBubbles()
{
- ::osl::MutexGuard const g(m_Mutex);
+ std::unique_lock const g(m_Mutex);
return m_bubbles;
}
sal_Bool SAL_CALL CEvent::getCancelable()
{
- ::osl::MutexGuard const g(m_Mutex);
+ std::unique_lock const g(m_Mutex);
return m_cancelable;
}
css::util::Time SAL_CALL
CEvent::getTimeStamp()
{
- ::osl::MutexGuard const g(m_Mutex);
+ std::unique_lock const g(m_Mutex);
return m_time;
}
void SAL_CALL CEvent::stopPropagation()
{
- ::osl::MutexGuard const g(m_Mutex);
+ std::unique_lock const g(m_Mutex);
if (m_cancelable) { m_canceled = true; }
}
@@ -96,7 +96,7 @@ namespace DOM::events
CEvent::initEvent(OUString const& eventTypeArg, sal_Bool canBubbleArg,
sal_Bool cancelableArg)
{
- ::osl::MutexGuard const g(m_Mutex);
+ std::unique_lock const g(m_Mutex);
m_eventType = eventTypeArg;
m_bubbles = canBubbleArg;
diff --git a/unoxml/source/events/mouseevent.cxx b/unoxml/source/events/mouseevent.cxx
index ee22b8905c70..4ae8a1b55741 100644
--- a/unoxml/source/events/mouseevent.cxx
+++ b/unoxml/source/events/mouseevent.cxx
@@ -40,47 +40,47 @@ namespace DOM::events
sal_Int32 SAL_CALL CMouseEvent::getScreenX()
{
- ::osl::MutexGuard const g(m_Mutex);
+ std::unique_lock const g(m_Mutex);
return m_screenX;
}
sal_Int32 SAL_CALL CMouseEvent::getScreenY()
{
- ::osl::MutexGuard const g(m_Mutex);
+ std::unique_lock const g(m_Mutex);
return m_screenY;
}
sal_Int32 SAL_CALL CMouseEvent::getClientX()
{
- ::osl::MutexGuard const g(m_Mutex);
+ std::unique_lock const g(m_Mutex);
return m_clientX;
}
sal_Int32 SAL_CALL CMouseEvent::getClientY()
{
- ::osl::MutexGuard const g(m_Mutex);
+ std::unique_lock const g(m_Mutex);
return m_clientY;
}
sal_Bool SAL_CALL CMouseEvent::getCtrlKey()
{
- ::osl::MutexGuard const g(m_Mutex);
+ std::unique_lock const g(m_Mutex);
return m_ctrlKey;
}
sal_Bool SAL_CALL CMouseEvent::getShiftKey()
{
- ::osl::MutexGuard const g(m_Mutex);
+ std::unique_lock const g(m_Mutex);
return m_shiftKey;
}
sal_Bool SAL_CALL CMouseEvent::getAltKey()
{
- ::osl::MutexGuard const g(m_Mutex);
+ std::unique_lock const g(m_Mutex);
return m_altKey;
}
sal_Bool SAL_CALL CMouseEvent::getMetaKey()
{
- ::osl::MutexGuard const g(m_Mutex);
+ std::unique_lock const g(m_Mutex);
return m_metaKey;
}
sal_Int16 SAL_CALL CMouseEvent::getButton()
{
- ::osl::MutexGuard const g(m_Mutex);
+ std::unique_lock const g(m_Mutex);
return m_button;
}
Reference< XEventTarget > SAL_CALL CMouseEvent::getRelatedTarget()
@@ -105,9 +105,8 @@ namespace DOM::events
sal_Int16 buttonArg,
const Reference< XEventTarget >& /*relatedTargetArg*/)
{
- ::osl::MutexGuard const g(m_Mutex);
-
CUIEvent::initUIEvent(typeArg, canBubbleArg, cancelableArg, viewArg, detailArg);
+ std::unique_lock const g(m_Mutex);
m_screenX = screenXArg;
m_screenY = screenYArg;
m_clientX = clientXArg;
diff --git a/unoxml/source/events/mutationevent.cxx b/unoxml/source/events/mutationevent.cxx
index 216c2b164022..8ef91f0e317e 100644
--- a/unoxml/source/events/mutationevent.cxx
+++ b/unoxml/source/events/mutationevent.cxx
@@ -36,31 +36,31 @@ namespace DOM::events
Reference< XNode > SAL_CALL CMutationEvent::getRelatedNode()
{
- ::osl::MutexGuard const g(m_Mutex);
+ std::unique_lock const g(m_Mutex);
return m_relatedNode;
}
OUString SAL_CALL CMutationEvent::getPrevValue()
{
- ::osl::MutexGuard const g(m_Mutex);
+ std::unique_lock const g(m_Mutex);
return m_prevValue;
}
OUString SAL_CALL CMutationEvent::getNewValue()
{
- ::osl::MutexGuard const g(m_Mutex);
+ std::unique_lock const g(m_Mutex);
return m_newValue;
}
OUString SAL_CALL CMutationEvent::getAttrName()
{
- ::osl::MutexGuard const g(m_Mutex);
+ std::unique_lock const g(m_Mutex);
return m_attrName;
}
AttrChangeType SAL_CALL CMutationEvent::getAttrChange()
{
- ::osl::MutexGuard const g(m_Mutex);
+ std::unique_lock const g(m_Mutex);
return m_attrChangeType;
}
@@ -70,9 +70,10 @@ namespace DOM::events
const OUString& newValueArg, const OUString& attrNameArg,
AttrChangeType attrChangeArg)
{
- ::osl::MutexGuard const g(m_Mutex);
-
CEvent::initEvent(typeArg, canBubbleArg, cancelableArg);
+
+ std::unique_lock const g(m_Mutex);
+
m_relatedNode = relatedNodeArg;
m_prevValue = prevValueArg;
m_newValue = newValueArg;
diff --git a/unoxml/source/events/uievent.cxx b/unoxml/source/events/uievent.cxx
index 6d4092fc6b24..be61ca5cf391 100644
--- a/unoxml/source/events/uievent.cxx
+++ b/unoxml/source/events/uievent.cxx
@@ -33,13 +33,13 @@ namespace DOM::events
Reference< XAbstractView > SAL_CALL
CUIEvent::getView()
{
- ::osl::MutexGuard const g(m_Mutex);
+ std::unique_lock const g(m_Mutex);
return m_view;
}
sal_Int32 SAL_CALL CUIEvent::getDetail()
{
- ::osl::MutexGuard const g(m_Mutex);
+ std::unique_lock const g(m_Mutex);
return m_detail;
}
@@ -49,9 +49,8 @@ namespace DOM::events
const Reference< XAbstractView >& viewArg,
sal_Int32 detailArg)
{
- ::osl::MutexGuard const g(m_Mutex);
-
CEvent::initEvent(typeArg, canBubbleArg, cancelableArg);
+ std::unique_lock const g(m_Mutex);
m_view = viewArg;
m_detail = detailArg;
}