summaryrefslogtreecommitdiffstats
path: root/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse
diff options
context:
space:
mode:
authorScott Kovatch <skovatch>2009-04-27 21:04:49 +0000
committerScott Kovatch <skovatch>2009-04-27 21:04:49 +0000
commit95de79fa4648091a6de9d216f1c45c8e89b5a2bb (patch)
tree45422e40e20640d34d20142f0571d22db92dd924 /bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse
parent8b393582b757492143309fbacd87fb2d85b164a6 (diff)
downloadeclipse.platform.swt-95de79fa4648091a6de9d216f1c45c8e89b5a2bb.tar.gz
eclipse.platform.swt-95de79fa4648091a6de9d216f1c45c8e89b5a2bb.tar.xz
eclipse.platform.swt-95de79fa4648091a6de9d216f1c45c8e89b5a2bb.zip
273635 - don't mess with the selection when determining if a drag can start.
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse')
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Table.java13
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Tree.java13
2 files changed, 2 insertions, 24 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Table.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Table.java
index af280a466b..93ea0ebe80 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Table.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Table.java
@@ -207,18 +207,7 @@ NSSize cellSize (int /*long*/ id, int /*long*/ sel) {
}
boolean canDragRowsWithIndexes_atPoint(int /*long*/ id, int /*long*/ sel, int /*long*/ arg0, int /*long*/ arg1) {
- NSPoint clickPoint = new NSPoint();
- OS.memmove(clickPoint, arg1, NSPoint.sizeof);
- NSTableView table = (NSTableView)view;
- int /*long*/ row = table.rowAtPoint(clickPoint);
- if (!table.isRowSelected(row)) {
- NSIndexSet set = (NSIndexSet)new NSIndexSet().alloc();
- set = set.initWithIndex(row);
- table.selectRowIndexes (set, false);
- set.release();
- }
-
- return ((state & DRAG_DETECT) != 0 && hooks (SWT.DragDetect));
+ return (getSelectionCount() > 0 && (state & DRAG_DETECT) != 0 && hooks (SWT.DragDetect));
}
boolean checkData (TableItem item) {
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Tree.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Tree.java
index a36ab40daa..479ae5ecd0 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Tree.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Tree.java
@@ -261,18 +261,7 @@ NSSize cellSize (int /*long*/ id, int /*long*/ sel) {
}
boolean canDragRowsWithIndexes_atPoint(int /*long*/ id, int /*long*/ sel, int /*long*/ arg0, int /*long*/ arg1) {
- NSPoint clickPoint = new NSPoint();
- OS.memmove(clickPoint, arg1, NSPoint.sizeof);
- NSOutlineView tree = (NSOutlineView)view;
- int /*long*/ row = tree.rowAtPoint(clickPoint);
- if (!tree.isRowSelected(row)) {
- NSIndexSet set = (NSIndexSet)new NSIndexSet().alloc();
- set = set.initWithIndex(row);
- tree.selectRowIndexes (set, false);
- set.release();
- }
-
- return ((state & DRAG_DETECT) != 0 && hooks (SWT.DragDetect));
+ return (getSelectionCount() > 0 && (state & DRAG_DETECT) != 0 && hooks (SWT.DragDetect));
}
boolean checkData (TreeItem item) {