summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBogdan Gheorghe <gheorghe@ca.ibm.com>2012-05-18 13:09:39 -0400
committerBogdan Gheorghe <gheorghe@ca.ibm.com>2012-05-18 13:09:39 -0400
commitf11fc9b6780c2e4b0ccd26bc0c1feb5a2337a29b (patch)
tree2a50a52f857f9d58edc6a85fe176c233141cfac2
parentb6a1857aca1ae03bbe426870f838497ceff6d642 (diff)
downloadeclipse.platform.swt-f11fc9b6780c2e4b0ccd26bc0c1feb5a2337a29b.tar.gz
eclipse.platform.swt-f11fc9b6780c2e4b0ccd26bc0c1feb5a2337a29b.tar.xz
eclipse.platform.swt-f11fc9b6780c2e4b0ccd26bc0c1feb5a2337a29b.zip
Bug 379791 - SWTException: Graphic is disposed for PlaceholderImpl
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CTabFolderRenderer.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CTabFolderRenderer.java b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CTabFolderRenderer.java
index 2d954d917c..17269ac065 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CTabFolderRenderer.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CTabFolderRenderer.java
@@ -242,7 +242,7 @@ public class CTabFolderRenderer {
CTabItem item = parent.items[part];
if (item.isDisposed()) return new Point(0,0);
Image image = item.getImage();
- if (image != null) {
+ if (image != null && !image.isDisposed()) {
Rectangle bounds = image.getBounds();
if ((state & SWT.SELECTED) != 0 || parent.showUnselectedImage) {
width += bounds.width;
@@ -1374,7 +1374,7 @@ public class CTabFolderRenderer {
int xDraw = x - trim.x;
if (parent.single && (parent.showClose || item.showClose)) xDraw += item.closeRect.width;
Image image = item.getImage();
- if (image != null) {
+ if (image != null && !image.isDisposed()) {
Rectangle imageBounds = image.getBounds();
// only draw image if it won't overlap with close button
int maxImageWidth = rightEdge - xDraw - (trim.width + trim.x);
@@ -1578,7 +1578,7 @@ public class CTabFolderRenderer {
Rectangle trim = computeTrim(index, SWT.NONE, 0, 0, 0, 0);
int xDraw = x - trim.x;
Image image = item.getImage();
- if (image != null && parent.showUnselectedImage) {
+ if (image != null && !image.isDisposed() && parent.showUnselectedImage) {
Rectangle imageBounds = image.getBounds();
// only draw image if it won't overlap with close button
int maxImageWidth = x + width - xDraw - (trim.width + trim.x);