Bug 450391 - Table doesn't reveal item when selection is set before
shell is opened
Change-Id: Id178b6da9f8946e6f4331e5b86b6704cc35bdc21
Signed-off-by: Niraj Modi <niraj.modi@in.ibm.com>
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Table.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Table.java
index 8a803a6..451aefc 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Table.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Table.java
@@ -5505,8 +5505,11 @@
* vertical scroll bar is no more visible/needed, even then top of
* the table is not visible. Fix is to make sure on show selection
* table gets vertically scrolled back to the top, refer bug 442275
+ *
+ * Make sure above fix is applied on an active shell, bug 450391
*/
- if ((style & SWT.NO_SCROLL) == 0 && (verticalBar == null || !verticalBar.isVisible())) {
+ if (display.getActiveShell() != null && (style & SWT.NO_SCROLL) == 0
+ && (verticalBar == null || !verticalBar.isVisible())) {
showItem (0);
} else {
showItem (index);