From 9efef2504d71a1f3dabca0ee9c4c8c10c8b77046 Mon Sep 17 00:00:00 2001
From: Carolyn MacLeod
Date: Mon, 18 Jun 2012 14:21:01 -0400
Subject: Bug 339342 - CTabFolder should throw IllegalArgumentException when a
disposed control is set as its top right control
---
.../common/org/eclipse/swt/custom/CTabFolder.java | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CTabFolder.java b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CTabFolder.java
index 2f0c3559ef..52c2d8bf2d 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CTabFolder.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CTabFolder.java
@@ -3371,7 +3371,7 @@ public void setTabPosition(int position) {
* @exception SWTException
* - ERROR_WIDGET_DISPOSED - if the receiver has been disposed
* - ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- * - ERROR_INVALID_ARGUMENT - if the control is not a child of this CTabFolder
+ * - ERROR_INVALID_ARGUMENT - if the control is disposed, or not a child of this CTabFolder
*
*
* @since 2.1
@@ -3400,7 +3400,7 @@ public void setTopRight(Control control) {
* @exception SWTException
* - ERROR_WIDGET_DISPOSED - if the receiver has been disposed
* - ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- * - ERROR_INVALID_ARGUMENT - if the control is not a child of this CTabFolder
+ * - ERROR_INVALID_ARGUMENT - if the control is disposed, or not a child of this CTabFolder
*
*
* @since 3.0
@@ -3410,7 +3410,7 @@ public void setTopRight(Control control, int alignment) {
if (alignment != SWT.RIGHT && alignment != SWT.FILL && alignment != (SWT.RIGHT | SWT.WRAP)) {
SWT.error(SWT.ERROR_INVALID_ARGUMENT);
}
- if (control != null && control.getParent() != this) {
+ if (control != null && (control.isDisposed() || control.getParent() != this)) {
SWT.error(SWT.ERROR_INVALID_ARGUMENT);
}
if (topRight == control && topRightAlignment == alignment) return;
--
cgit v1.2.3