summaryrefslogtreecommitdiffstats
path: root/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets
diff options
context:
space:
mode:
authorBogdan Gheorghe <gheorghe@ca.ibm.com>2012-09-17 17:23:43 -0400
committerBogdan Gheorghe <gheorghe@ca.ibm.com>2012-09-17 17:24:27 -0400
commit904aa8e66865aac43a319b71f9cd05d128d766ae (patch)
treeedb27410020320dc015007708d19f4c83cbb439d /bundles/org.eclipse.swt/Eclipse SWT Custom Widgets
parent45ebb6f2bb21bad85e6e72f4a7314b8748844909 (diff)
downloadeclipse.platform.swt-904aa8e66865aac43a319b71f9cd05d128d766ae.tar.gz
eclipse.platform.swt-904aa8e66865aac43a319b71f9cd05d128d766ae.tar.xz
eclipse.platform.swt-904aa8e66865aac43a319b71f9cd05d128d766ae.zip
Need to pass in a gc to avoid NPE in renderer
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT Custom Widgets')
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CTabFolder.java4
1 files changed, 3 insertions, 1 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 b7306d1588..59c0d10dce 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
@@ -635,7 +635,9 @@ public Rectangle computeTrim (int x, int y, int width, int height) {
return trim;
}
Image createButtonImage(Display display, int button) {
- Point size = renderer.computeSize(button, SWT.NONE, null, SWT.DEFAULT, SWT.DEFAULT);
+ GC tempGC = new GC (this);
+ Point size = renderer.computeSize(button, SWT.NONE, tempGC, SWT.DEFAULT, SWT.DEFAULT);
+ tempGC.dispose();
Rectangle trim = renderer.computeTrim(button, SWT.NONE, 0, 0, 0, 0);
Image image = new Image (display, size.x - trim.width, size.y - trim.height);
GC gc = new GC (image);