diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2023-04-23 20:15:40 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2023-05-28 11:50:12 +0200 |
commit | b4de1a98e61a75782464a440a33acf7435e1bbb9 (patch) | |
tree | 8eb0199cad5d147036a7fa1d604994d042fc84e4 /vcl/osx | |
parent | 44239426ad12050b0e3a7db87efa202288ba2e14 (diff) |
Use getXWeak in vcl
Change-Id: I665c9dc8c4f9cc4a996d9bf990cbfa33822bd07f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150885
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'vcl/osx')
-rw-r--r-- | vcl/osx/DragSource.cxx | 14 | ||||
-rw-r--r-- | vcl/osx/DropTarget.cxx | 10 | ||||
-rw-r--r-- | vcl/osx/clipboard.cxx | 2 |
3 files changed, 13 insertions, 13 deletions
diff --git a/vcl/osx/DragSource.cxx b/vcl/osx/DragSource.cxx index bf2c0c25a310..fbe3b216a653 100644 --- a/vcl/osx/DragSource.cxx +++ b/vcl/osx/DragSource.cxx @@ -97,7 +97,7 @@ static Sequence<OUString> dragSource_getSupportedServiceNames() { (void)anImage; (void)aPoint; - DragSourceDragEvent dsde(static_cast<OWeakObject*>(mDragSource), + DragSourceDragEvent dsde(mDragSource->getXWeak(), new DragSourceContext, mDragSource, DNDConstants::ACTION_COPY, @@ -116,7 +116,7 @@ static Sequence<OUString> dragSource_getSupportedServiceNames() if( DragSource::g_DropSuccessSet ) bDropSuccess = DragSource::g_DropSuccess; - DragSourceDropEvent dsde(static_cast<OWeakObject*>(mDragSource), + DragSourceDropEvent dsde(mDragSource->getXWeak(), new DragSourceContext, static_cast< XDragSource* >(mDragSource), SystemToOfficeDragActions(operation), @@ -130,7 +130,7 @@ static Sequence<OUString> dragSource_getSupportedServiceNames() { (void)draggedImage; (void)screenPoint; - DragSourceDragEvent dsde(static_cast<OWeakObject*>(mDragSource), + DragSourceDragEvent dsde(mDragSource->getXWeak(), new DragSourceContext, mDragSource, DNDConstants::ACTION_COPY, @@ -163,7 +163,7 @@ void SAL_CALL DragSource::initialize(const Sequence< Any >& aArguments) if (aArguments.getLength() < 2) { throw Exception("DragSource::initialize: Not enough parameter.", - static_cast<OWeakObject*>(this)); + getXWeak()); } Any pNSView = aArguments[1]; @@ -181,13 +181,13 @@ void SAL_CALL DragSource::initialize(const Sequence< Any >& aArguments) ![mView respondsToSelector: @selector(unregisterMouseEventListener:)]) { throw Exception("DragSource::initialize: Provided view doesn't support mouse listener", - static_cast<OWeakObject*>(this)); + getXWeak()); } NSWindow* pWin = [mView window]; if( ! pWin || ![pWin respondsToSelector: @selector(getSalFrame)] ) { throw Exception("DragSource::initialize: Provided view is not attached to a vcl frame", - static_cast<OWeakObject*>(this)); + getXWeak()); } mpFrame = reinterpret_cast<AquaSalFrame*>([pWin performSelector: @selector(getSalFrame)]); @@ -196,7 +196,7 @@ void SAL_CALL DragSource::initialize(const Sequence< Any >& aArguments) if (mDragSourceHelper == nil) { throw Exception("DragSource::initialize: Cannot initialize DragSource", - static_cast<OWeakObject*>(this)); + getXWeak()); } [static_cast<id <MouseEventListener>>(mView) registerMouseEventListener: mDragSourceHelper]; diff --git a/vcl/osx/DropTarget.cxx b/vcl/osx/DropTarget.cxx index 56407a40abe9..d9e34030d11f 100644 --- a/vcl/osx/DropTarget.cxx +++ b/vcl/osx/DropTarget.cxx @@ -216,7 +216,7 @@ NSDragOperation DropTarget::draggingEntered(id sender) uno::Reference<XTransferable> xTransferable = DragSource::g_XTransferable.is() ? DragSource::g_XTransferable : mXCurrentDragClipboard->getContents(); - DropTargetDragEnterEvent dtdee(static_cast<OWeakObject*>(this), + DropTargetDragEnterEvent dtdee(getXWeak(), 0, this, currentAction, @@ -251,7 +251,7 @@ NSDragOperation DropTarget::draggingUpdated(id sender) sal_Int32 posX = static_cast<sal_Int32>(dragLocation.x); sal_Int32 posY = static_cast<sal_Int32>(dragLocation.y); - DropTargetDragEvent dtde(static_cast<OWeakObject*>(this), + DropTargetDragEvent dtde(getXWeak(), 0, this, currentAction, @@ -281,7 +281,7 @@ NSDragOperation DropTarget::draggingUpdated(id sender) void DropTarget::draggingExited(id /*sender*/) { - DropTargetEvent dte(static_cast<OWeakObject*>(this), 0); + DropTargetEvent dte(getXWeak(), 0); fire_dragExit(dte); mDragSourceSupportedActions = DNDConstants::ACTION_NONE; mSelectedDropAction = DNDConstants::ACTION_NONE; @@ -317,7 +317,7 @@ BOOL DropTarget::performDragOperation() sal_Int32 posX = static_cast<sal_Int32>(dragLocation.x); sal_Int32 posY = static_cast<sal_Int32>(dragLocation.y); - DropTargetDropEvent dtde(static_cast<OWeakObject*>(this), + DropTargetDropEvent dtde(getXWeak(), 0, this, mSelectedDropAction, @@ -354,7 +354,7 @@ void SAL_CALL DropTarget::initialize(const Sequence< Any >& aArguments) if (aArguments.getLength() < 2) { throw RuntimeException("DropTarget::initialize: Cannot install window event handler", - static_cast<OWeakObject*>(this)); + getXWeak()); } Any pNSView = aArguments[0]; diff --git a/vcl/osx/clipboard.cxx b/vcl/osx/clipboard.cxx index cc99c3c985d9..2dc2d5eef888 100644 --- a/vcl/osx/clipboard.cxx +++ b/vcl/osx/clipboard.cxx @@ -253,7 +253,7 @@ void AquaClipboard::fireClipboardChangedEvent() if (!mClipboardListeners.empty()) { - aEvent = datatransfer::clipboard::ClipboardEvent(static_cast<OWeakObject*>(this), getContents()); + aEvent = datatransfer::clipboard::ClipboardEvent(getXWeak(), getContents()); } aGuard.clear(); |