Bug 566043 - Unreadable project names in import wizard

Change-Id: I7cbfe3ec1cd96bf36ce4a9852b4cdb7156c62b71
Signed-off-by: Sravan Kumar Lakkimsetti <sravankumarl@in.ibm.com>
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/TableItem.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/TableItem.java
index 1239b77..e09d0bd 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/TableItem.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/TableItem.java
@@ -607,14 +607,14 @@
 
 	NSTableView tableView = (NSTableView) parent.view;
 	Image image = index == 0 ? this.image : (images != null) ? images [index] : null;
+	Font f = (cellFont != null ? cellFont[index] : null);
+	NSSize size = getTextExtent(getText(index), f);
 	if (parent.columnCount == 0) {
 		index = (parent.style & SWT.CHECK) != 0 ? 1 : 0;
 	} else {
 		TableColumn column = parent.getColumn (index);
 		index = parent.indexOf (column.nsColumn);
 	}
-	Font f = (cellFont != null ? cellFont[index] : null);
-	NSSize size = getTextExtent(getText(index), f);
 	NSRect rect = tableView.frameOfCellAtColumn (index, parent.indexOf (this));
 	rect.x += Table.TEXT_GAP;
 	rect.width = size.width;
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/TreeItem.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/TreeItem.java
index b700789..8cb2eff 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/TreeItem.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/TreeItem.java
@@ -839,15 +839,15 @@
 	parent.checkItems ();
 	NSOutlineView outlineView = (NSOutlineView) parent.view;
 	Image image = index == 0 ? this.image : (images != null) ? images [index] : null;
+	Font f = (cellFont != null ? cellFont[index] : null);
+	String text = index == 0 ? this.text : (strings == null ? "" : strings [index]);
+	NSSize size = getTextExtent(text, f);
 	if (parent.columnCount == 0) {
 		index = (parent.style & SWT.CHECK) != 0 ? 1 : 0;
 	} else {
 		TreeColumn column = parent.getColumn (index);
 		index = parent.indexOf (column.nsColumn);
 	}
-	Font f = (cellFont != null ? cellFont[index] : null);
-	String text = index == 0 ? this.text : (strings == null ? "" : strings [index]);
-	NSSize size = getTextExtent(text, f);
 
 	NSRect rect = outlineView.frameOfCellAtColumn (index, outlineView.rowForItem (handle));
 	rect.x += Tree.TEXT_GAP;