summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2021-12-23 22:10:42 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-12-24 10:39:26 +0100
commitac5d7288ce9ec08e3bfda3c4803ce736c1527568 (patch)
tree0f17f81088775b1f0d75ba384d7bad0b02d7f310 /vcl
parente31191d45c27965bb1a73577b9fcc99b5d88795a (diff)
use comphelper::WeakComponentImplHelper in JSDropTarget
Change-Id: I40f8090e0c24a29bdb310183981187997696f8e3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127398 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/inc/jsdialog/jsdialogbuilder.hxx7
-rw-r--r--vcl/jsdialog/jsdialogbuilder.cxx17
2 files changed, 10 insertions, 14 deletions
diff --git a/vcl/inc/jsdialog/jsdialogbuilder.hxx b/vcl/inc/jsdialog/jsdialogbuilder.hxx
index 3d14a1150576..f402aeab4cb8 100644
--- a/vcl/inc/jsdialog/jsdialogbuilder.hxx
+++ b/vcl/inc/jsdialog/jsdialogbuilder.hxx
@@ -23,7 +23,7 @@
#include <com/sun/star/lang/XInitialization.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/datatransfer/dnd/XDropTarget.hpp>
-#include <cppuhelper/compbase.hxx>
+#include <comphelper/compbase.hxx>
#include <deque>
#include <list>
@@ -165,10 +165,9 @@ protected:
};
class JSDropTarget final
- : public cppu::WeakComponentImplHelper<css::datatransfer::dnd::XDropTarget,
- css::lang::XInitialization, css::lang::XServiceInfo>
+ : public comphelper::WeakComponentImplHelper<
+ css::datatransfer::dnd::XDropTarget, css::lang::XInitialization, css::lang::XServiceInfo>
{
- osl::Mutex m_aMutex;
std::vector<css::uno::Reference<css::datatransfer::dnd::XDropTargetListener>> m_aListeners;
public:
diff --git a/vcl/jsdialog/jsdialogbuilder.cxx b/vcl/jsdialog/jsdialogbuilder.cxx
index e4718f7302ac..a9ed9b34678c 100644
--- a/vcl/jsdialog/jsdialogbuilder.cxx
+++ b/vcl/jsdialog/jsdialogbuilder.cxx
@@ -406,17 +406,14 @@ public:
static JSTreeView* g_DragSource;
-JSDropTarget::JSDropTarget()
- : WeakComponentImplHelper(m_aMutex)
-{
-}
+JSDropTarget::JSDropTarget() {}
void JSDropTarget::initialize(const css::uno::Sequence<css::uno::Any>& /*rArgs*/) {}
void JSDropTarget::addDropTargetListener(
const css::uno::Reference<css::datatransfer::dnd::XDropTargetListener>& xListener)
{
- ::osl::Guard<::osl::Mutex> aGuard(m_aMutex);
+ std::unique_lock aGuard(m_aMutex);
m_aListeners.push_back(xListener);
}
@@ -424,7 +421,7 @@ void JSDropTarget::addDropTargetListener(
void JSDropTarget::removeDropTargetListener(
const css::uno::Reference<css::datatransfer::dnd::XDropTargetListener>& xListener)
{
- ::osl::Guard<::osl::Mutex> aGuard(m_aMutex);
+ std::unique_lock aGuard(m_aMutex);
m_aListeners.erase(std::remove(m_aListeners.begin(), m_aListeners.end(), xListener),
m_aListeners.end());
@@ -456,10 +453,10 @@ css::uno::Sequence<OUString> JSDropTarget::getSupportedServiceNames()
void JSDropTarget::fire_drop(const css::datatransfer::dnd::DropTargetDropEvent& dtde)
{
- osl::ClearableGuard<osl::Mutex> aGuard(m_aMutex);
+ std::unique_lock aGuard(m_aMutex);
std::vector<css::uno::Reference<css::datatransfer::dnd::XDropTargetListener>> aListeners(
m_aListeners);
- aGuard.clear();
+ aGuard.unlock();
for (auto const& listener : aListeners)
{
@@ -469,10 +466,10 @@ void JSDropTarget::fire_drop(const css::datatransfer::dnd::DropTargetDropEvent&
void JSDropTarget::fire_dragEnter(const css::datatransfer::dnd::DropTargetDragEnterEvent& dtde)
{
- osl::ClearableGuard<::osl::Mutex> aGuard(m_aMutex);
+ std::unique_lock aGuard(m_aMutex);
std::vector<css::uno::Reference<css::datatransfer::dnd::XDropTargetListener>> aListeners(
m_aListeners);
- aGuard.clear();
+ aGuard.unlock();
for (auto const& listener : aListeners)
{