diff options
author | Bogdan Gheorghe <gheorghe@ca.ibm.com> | 2012-05-18 13:09:39 -0400 |
---|---|---|
committer | Bogdan Gheorghe <gheorghe@ca.ibm.com> | 2012-05-18 13:13:24 -0400 |
commit | 3bcbaf48e5b475a67983e24f72b5e6eac9b05c7e (patch) | |
tree | ed1c8d30f9c6356ec21ffe24b36d1279b0097ef7 | |
parent | 818e98f24a418073df799a942f66e1a2e2de2455 (diff) | |
download | eclipse.platform.swt-3bcbaf48e5b475a67983e24f72b5e6eac9b05c7e.tar.gz eclipse.platform.swt-3bcbaf48e5b475a67983e24f72b5e6eac9b05c7e.tar.xz eclipse.platform.swt-3bcbaf48e5b475a67983e24f72b5e6eac9b05c7e.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.java | 6 |
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 3613304f4d..a2416a4120 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 @@ -282,7 +282,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; @@ -1409,7 +1409,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); @@ -1613,7 +1613,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); |