Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIvan Furnadjiev2017-04-19 09:35:08 +0000
committerGerrit Code Review @ Eclipse.org2017-05-04 08:10:46 +0000
commitf2b65a38fc08e077d4ae137d2efb1ed732cc9f0e (patch)
treede084fa36028adebc234edd11a8643073306f36e /bundles
parent6e2768affd3cb5c4a6953f4b8e27d7453dddc391 (diff)
downloadorg.eclipse.rap-f2b65a38fc08e077d4ae137d2efb1ed732cc9f0e.tar.gz
org.eclipse.rap-f2b65a38fc08e077d4ae137d2efb1ed732cc9f0e.tar.xz
org.eclipse.rap-f2b65a38fc08e077d4ae137d2efb1ed732cc9f0e.zip
Don't use cached item widths after TSD repack
TextSizeRecalculation#clearLayoutBuffers calls Composite#changed to ensure that no cache data are used after real text sizes are available. In Tree widget the cached item text widths are correctly cleared, but not in Table. Align the implementation with Tree widget - clear cashed item widths in "changed" method. 515247: Table column is packed correctly only after two calls to pack() https://bugs.eclipse.org/bugs/show_bug.cgi?id=515247 Change-Id: Iada27dee4d83f67285658413c77c1e4d2b050b8b
Diffstat (limited to 'bundles')
-rw-r--r--bundles/org.eclipse.rap.rwt/src/org/eclipse/swt/widgets/Table.java8
-rw-r--r--bundles/org.eclipse.rap.rwt/src/org/eclipse/swt/widgets/TableItem.java11
2 files changed, 16 insertions, 3 deletions
diff --git a/bundles/org.eclipse.rap.rwt/src/org/eclipse/swt/widgets/Table.java b/bundles/org.eclipse.rap.rwt/src/org/eclipse/swt/widgets/Table.java
index 15db99c5b1..b014d49cce 100644
--- a/bundles/org.eclipse.rap.rwt/src/org/eclipse/swt/widgets/Table.java
+++ b/bundles/org.eclipse.rap.rwt/src/org/eclipse/swt/widgets/Table.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2002, 2015 Innoopract Informationssysteme GmbH and others.
+ * Copyright (c) 2002, 2017 Innoopract Informationssysteme GmbH and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -2113,6 +2113,12 @@ public class Table extends Composite {
}
}
+ @Override
+ public void changed( Control[] changed ) {
+ clearItemsTextWidths();
+ super.changed( changed );
+ }
+
/////////////////////////////
// Create and destroy columns
diff --git a/bundles/org.eclipse.rap.rwt/src/org/eclipse/swt/widgets/TableItem.java b/bundles/org.eclipse.rap.rwt/src/org/eclipse/swt/widgets/TableItem.java
index 4b4c77b0d2..d329e24567 100644
--- a/bundles/org.eclipse.rap.rwt/src/org/eclipse/swt/widgets/TableItem.java
+++ b/bundles/org.eclipse.rap.rwt/src/org/eclipse/swt/widgets/TableItem.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2002, 2015 Innoopract Informationssysteme GmbH and others.
+ * Copyright (c) 2002, 2017 Innoopract Informationssysteme GmbH and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -1049,6 +1049,13 @@ public class TableItem extends Item {
}
}
+ boolean hasTextWidthBuffer( int index ) {
+ if( hasData( index ) ) {
+ return data[ index ].textWidth != Data.UNKNOWN_WIDTH;
+ }
+ return false;
+ }
+
private int getSpacing( int index ) {
int result = 0;
if( parent.hasColumnImages( index ) ) {
@@ -1276,4 +1283,4 @@ public class TableItem extends Item {
Color foreground;
}
-} \ No newline at end of file
+}

Back to the top