summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/TreeColumn.java2
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/TreeItem.java4
2 files changed, 4 insertions, 2 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/TreeColumn.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/TreeColumn.java
index feb8ea1e95..f54795f09f 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/TreeColumn.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/TreeColumn.java
@@ -459,7 +459,7 @@ public void pack () {
int index = parent.indexOf (this);
for (int i=0; i<parent.itemCount; i++) {
TreeItem item = parent.items [i];
- if (item != null && !item.isDisposed () && item.cached) {
+ if (item != null && !item.isDisposed ()) {
width = Math.max (width, item.calculateWidth (index, gc, true, true));
if (isDisposed ()) {
gc.dispose ();
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 5d15a3a2cd..f72a0c52c1 100755
--- 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
@@ -230,6 +230,8 @@ static int checkIndex (int index) {
/* note that the result includes tree hierarchy indentation for column 0 */
int calculateWidth (int columnIndex, GC gc, boolean recurse, boolean callMeasureItem) {
+ if (!cached) return 0;
+
int width = 0;
if (!callMeasureItem && customWidth != -1) {
width = customWidth;
@@ -287,7 +289,7 @@ int calculateWidth (int columnIndex, GC gc, boolean recurse, boolean callMeasure
if (recurse && expanded) {
for (int i = 0; i < items.length; i++) {
TreeItem item = items [i];
- if (item != null && !item.isDisposed () && item.cached) {
+ if (item != null && !item.isDisposed ()) {
width = Math.max (width, item.calculateWidth (columnIndex, gc, recurse, callMeasureItem));
}
}