summaryrefslogtreecommitdiff
path: root/vcl/aqua
diff options
context:
space:
mode:
authorPhilipp Lohmann [pl] <Philipp.Lohmann@Oracle.COM>2011-02-09 16:01:11 +0100
committerPhilipp Lohmann [pl] <Philipp.Lohmann@Oracle.COM>2011-02-09 16:01:11 +0100
commit1a6359d24aa881152288520ceb273c99dc6b04b7 (patch)
tree7f300adc1f2db6164296927d6d99d715786af7dc /vcl/aqua
parentb9cd8335c89822a56dee899f32164ba216d86b53 (diff)
vcl119: #i116131# catch meanwhile invalid pointers
Diffstat (limited to 'vcl/aqua')
-rwxr-xr-xvcl/aqua/inc/salframeview.h1
-rw-r--r--vcl/aqua/source/dtrans/DropTarget.cxx10
-rw-r--r--vcl/aqua/source/dtrans/DropTarget.hxx2
-rwxr-xr-xvcl/aqua/source/window/salframeview.mm5
4 files changed, 16 insertions, 2 deletions
diff --git a/vcl/aqua/inc/salframeview.h b/vcl/aqua/inc/salframeview.h
index e7d9a14b52aa..1d8ebcff8261 100755
--- a/vcl/aqua/inc/salframeview.h
+++ b/vcl/aqua/inc/salframeview.h
@@ -85,6 +85,7 @@
}
+(void)unsetMouseFrame: (AquaSalFrame*)pFrame;
-(id)initWithSalFrame: (AquaSalFrame*)pFrame;
+-(AquaSalFrame*)getSalFrame;
-(MacOSBOOL)acceptsFirstResponder;
-(MacOSBOOL)acceptsFirstMouse: (NSEvent *)pEvent;
-(MacOSBOOL)isOpaque;
diff --git a/vcl/aqua/source/dtrans/DropTarget.cxx b/vcl/aqua/source/dtrans/DropTarget.cxx
index c928d66e156d..e0e19e0f0062 100644
--- a/vcl/aqua/source/dtrans/DropTarget.cxx
+++ b/vcl/aqua/source/dtrans/DropTarget.cxx
@@ -50,6 +50,8 @@
#include <Carbon/Carbon.h>
#include <postmac.h>
+#include <salframe.h>
+#include <salframeview.h>
using namespace rtl;
using namespace cppu;
@@ -149,6 +151,8 @@ namespace /* private */
DropTarget::DropTarget() :
WeakComponentImplHelper5<XInitialization, XDropTarget, XDropTargetDragContext, XDropTargetDropContext, XServiceInfo>(m_aMutex),
+ mView(nil),
+ mpFrame(NULL),
mDropTargetHelper(nil),
mbActive(false),
mDragSourceSupportedActions(DNDConstants::ACTION_NONE),
@@ -161,8 +165,9 @@ DropTarget::DropTarget() :
DropTarget::~DropTarget()
{
- [(id <DraggingDestinationHandler>)mView unregisterDraggingDestinationHandler:mDropTargetHelper];
- [mDropTargetHelper release];
+ if( AquaSalFrame::isAlive( mpFrame ) )
+ [(id <DraggingDestinationHandler>)mView unregisterDraggingDestinationHandler:mDropTargetHelper];
+ [mDropTargetHelper release];
}
@@ -396,6 +401,7 @@ MacOSBOOL DropTarget::performDragOperation(id sender)
sal_uInt64 tmp = 0;
pNSView >>= tmp;
mView = (id)tmp;
+ mpFrame = [(SalFrameView*)mView getSalFrame];
mDropTargetHelper = [[DropTargetHelper alloc] initWithDropTarget: this];
diff --git a/vcl/aqua/source/dtrans/DropTarget.hxx b/vcl/aqua/source/dtrans/DropTarget.hxx
index 6baa8bb69d01..0cf0c0c1f278 100644
--- a/vcl/aqua/source/dtrans/DropTarget.hxx
+++ b/vcl/aqua/source/dtrans/DropTarget.hxx
@@ -51,6 +51,7 @@
#include <postmac.h>
class DropTarget;
+class AquaSalFrame;
/* The functions declared in this protocol are actually
declared in vcl/aqua/inc/salframe.h. Because we want
@@ -159,6 +160,7 @@ private:
com::sun::star::uno::Reference< com::sun::star::datatransfer::clipboard::XClipboard > mXCurrentDragClipboard;
DataFlavorMapperPtr_t mDataFlavorMapper;
id mView;
+ AquaSalFrame* mpFrame;
DropTargetHelper* mDropTargetHelper;
bool mbActive;
sal_Int8 mDragSourceSupportedActions;
diff --git a/vcl/aqua/source/window/salframeview.mm b/vcl/aqua/source/window/salframeview.mm
index bc87ea444710..d3897c4fb622 100755
--- a/vcl/aqua/source/window/salframeview.mm
+++ b/vcl/aqua/source/window/salframeview.mm
@@ -398,6 +398,11 @@ static AquaSalFrame* getMouseContainerFrame()
return self;
}
+-(AquaSalFrame*)getSalFrame
+{
+ return mpFrame;
+}
+
-(void)resetCursorRects
{
if( mpFrame && AquaSalFrame::isAlive( mpFrame ) )