Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSilenio Quarti2012-10-31 15:56:30 +0000
committerSilenio Quarti2012-10-31 15:56:30 +0000
commit06681aff359dac7ca29747c7c2b20038fa41772c (patch)
tree3ea3dfbc4ee02712ca569f8a171c9054d3a42374 /bundles/org.eclipse.swt
parenta8001c19478126e8fdf5c5b46d1536f8541ed8ab (diff)
downloadeclipse.platform.swt-06681aff359dac7ca29747c7c2b20038fa41772c.tar.gz
eclipse.platform.swt-06681aff359dac7ca29747c7c2b20038fa41772c.tar.xz
eclipse.platform.swt-06681aff359dac7ca29747c7c2b20038fa41772c.zip
Bug 130270 - Backport Bug 326311 to Eclipse 3.6.2v3659g
Diffstat (limited to 'bundles/org.eclipse.swt')
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Tree.java8
1 files changed, 7 insertions, 1 deletions
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 671b95a859..9f54333ee6 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
@@ -422,6 +422,7 @@ void clearCachedWidth (TreeItem[] items) {
void collapseItem_collapseChildren (int /*long*/ id, int /*long*/ sel, int /*long*/ itemID, boolean children) {
TreeItem item = (TreeItem)display.getWidget(itemID);
+ if (item == null) return;
if (!ignoreExpand) item.sendExpand (false, children);
ignoreExpand = true;
super.collapseItem_collapseChildren (id, sel, itemID, children);
@@ -922,6 +923,7 @@ void drawInteriorWithFrame_inView (int /*long*/ id, int /*long*/ sel, NSRect rec
int /*long*/ [] outValue = new int /*long*/ [1];
OS.object_getInstanceVariable(id, Display.SWT_ROW, outValue);
TreeItem item = (TreeItem) display.getWidget (outValue [0]);
+ if (item == null) return;
int /*long*/ rowIndex = widget.rowForItem(item.handle);
OS.object_getInstanceVariable(id, Display.SWT_COLUMN, outValue);
int /*long*/ tableColumn = outValue[0];
@@ -1183,6 +1185,7 @@ void drawWithExpansionFrame_inView (int /*long*/ id, int /*long*/ sel, NSRect ce
void expandItem_expandChildren (int /*long*/ id, int /*long*/ sel, int /*long*/ itemID, boolean children) {
TreeItem item = (TreeItem)display.getWidget(itemID);
+ if (item == null) return;
if (!ignoreExpand) item.sendExpand (true, children);
ignoreExpand = true;
super.expandItem_expandChildren (id, sel, itemID, children);
@@ -1948,11 +1951,12 @@ void mouseDownSuper(int /*long*/ id, int /*long*/ sel, int /*long*/ theEvent) {
NSEvent nsEvent = new NSEvent(theEvent);
NSPoint pt = view.convertPoint_fromView_(nsEvent.locationInWindow(), null);
int row = (int)/*64*/widget.rowAtPoint(pt);
+ NSObject itemID = null;
+ if (row != -1) itemID = new NSObject(widget.itemAtRow(row));
if (row != -1 && (nsEvent.modifierFlags() & OS.NSDeviceIndependentModifierFlagsMask) == 0) {
if (widget.isRowSelected(row)) {
NSRect rect = widget.frameOfOutlineCellAtRow(row);
if (!OS.NSPointInRect(pt, rect)) {
- id itemID = widget.itemAtRow(row);
Widget item = itemID != null ? display.getWidget (itemID.id) : null;
if (item != null && item instanceof TreeItem) {
Event event = new Event ();
@@ -1972,7 +1976,9 @@ void mouseDownSuper(int /*long*/ id, int /*long*/ sel, int /*long*/ theEvent) {
}
display.trackedButtonRow = -1;
didSelect = false;
+ if (itemID != null) itemID.retain();
super.mouseDownSuper(id, sel, theEvent);
+ if (itemID != null) itemID.release();
didSelect = false;
}

Back to the top