From 870a3b5bc34d5d4082b46940822d871106cac2d9 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Thu, 23 Dec 2021 21:38:41 +0200 Subject: 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 --- unoxml/inc/event.hxx | 3 ++- unoxml/source/events/event.cxx | 18 +++++++++--------- unoxml/source/events/mouseevent.cxx | 21 ++++++++++----------- unoxml/source/events/mutationevent.cxx | 15 ++++++++------- unoxml/source/events/uievent.cxx | 7 +++---- 5 files changed, 32 insertions(+), 32 deletions(-) (limited to 'unoxml') 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 #include +#include 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; } -- cgit