Skip to content

Commit

Permalink
osl::Mutex->std::mutex in DNDEventDispatcher
Browse files Browse the repository at this point in the history
Change-Id: I95e4dc636fc16095044d01e1c1e1314f107b23b7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119850
Tested-by: Jenkins
Reviewed-by: Noel Grandin <[email protected]>
  • Loading branch information
Noel Grandin committed Aug 2, 2021
1 parent 76b619c commit 8de81db
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
3 changes: 2 additions & 1 deletion vcl/inc/dndeventdispatcher.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include <com/sun/star/datatransfer/dnd/XDragGestureListener.hpp>
#include <cppuhelper/implbase.hxx>
#include <vcl/window.hxx>
#include <mutex>

class DNDEventDispatcher final : public ::cppu::WeakImplHelper<
css::datatransfer::dnd::XDropTargetListener,
Expand All @@ -38,7 +39,7 @@ class DNDEventDispatcher final : public ::cppu::WeakImplHelper<
void designate_currentwindow(vcl::Window *pWindow);
DECL_LINK(WindowEventListener, VclWindowEvent&, void);

::osl::Mutex m_aMutex;
std::mutex m_aMutex;
css::uno::Sequence< css::datatransfer::DataFlavor > m_aDataFlavorList;

vcl::Window* findTopLevelWindow(Point location);
Expand Down
12 changes: 6 additions & 6 deletions vcl/source/window/dndeventdispatcher.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ void DNDEventDispatcher::designate_currentwindow(vcl::Window *pWindow)

void SAL_CALL DNDEventDispatcher::drop( const DropTargetDropEvent& dtde )
{
osl::MutexGuard aImplGuard( m_aMutex );
std::lock_guard aImplGuard( m_aMutex );

Point location( dtde.LocationX, dtde.LocationY );

Expand Down Expand Up @@ -119,7 +119,7 @@ void SAL_CALL DNDEventDispatcher::drop( const DropTargetDropEvent& dtde )

void SAL_CALL DNDEventDispatcher::dragEnter( const DropTargetDragEnterEvent& dtdee )
{
osl::MutexGuard aImplGuard( m_aMutex );
std::lock_guard aImplGuard( m_aMutex );
Point location( dtdee.LocationX, dtdee.LocationY );

vcl::Window * pChildWindow = findTopLevelWindow(location);
Expand All @@ -142,7 +142,7 @@ void SAL_CALL DNDEventDispatcher::dragEnter( const DropTargetDragEnterEvent& dtd

void SAL_CALL DNDEventDispatcher::dragExit( const DropTargetEvent& /*dte*/ )
{
osl::MutexGuard aImplGuard( m_aMutex );
std::lock_guard aImplGuard( m_aMutex );

fireDragExitEvent( m_pCurrentWindow );

Expand All @@ -153,7 +153,7 @@ void SAL_CALL DNDEventDispatcher::dragExit( const DropTargetEvent& /*dte*/ )

void SAL_CALL DNDEventDispatcher::dragOver( const DropTargetDragEvent& dtde )
{
osl::MutexGuard aImplGuard( m_aMutex );
std::lock_guard aImplGuard( m_aMutex );

Point location( dtde.LocationX, dtde.LocationY );
sal_Int32 nListeners;
Expand Down Expand Up @@ -189,7 +189,7 @@ void SAL_CALL DNDEventDispatcher::dragOver( const DropTargetDragEvent& dtde )

void SAL_CALL DNDEventDispatcher::dropActionChanged( const DropTargetDragEvent& dtde )
{
osl::MutexGuard aImplGuard( m_aMutex );
std::lock_guard aImplGuard( m_aMutex );

Point location( dtde.LocationX, dtde.LocationY );
sal_Int32 nListeners;
Expand Down Expand Up @@ -225,7 +225,7 @@ void SAL_CALL DNDEventDispatcher::dropActionChanged( const DropTargetDragEvent&

void SAL_CALL DNDEventDispatcher::dragGestureRecognized( const DragGestureEvent& dge )
{
osl::MutexGuard aImplGuard( m_aMutex );
std::lock_guard aImplGuard( m_aMutex );

Point origin( dge.DragOriginX, dge.DragOriginY );

Expand Down

0 comments on commit 8de81db

Please sign in to comment.