diff options
author | Silenio Quarti <silenio> | 2005-04-28 14:08:30 +0000 |
---|---|---|
committer | Silenio Quarti <silenio> | 2005-04-28 14:08:30 +0000 |
commit | f1ffe447f89a7d8532ffe030209f91a9cbb41cb7 (patch) | |
tree | a17bee881a6bd53aa67a05c42a322f30063d67d3 /bundles | |
parent | 318db07572f802684686e2d87de4c5cccc86c0c1 (diff) | |
download | eclipse.platform.swt-f1ffe447f89a7d8532ffe030209f91a9cbb41cb7.tar.gz eclipse.platform.swt-f1ffe447f89a7d8532ffe030209f91a9cbb41cb7.tar.xz eclipse.platform.swt-f1ffe447f89a7d8532ffe030209f91a9cbb41cb7.zip |
*** empty log message ***
Diffstat (limited to 'bundles')
5 files changed, 17 insertions, 12 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cairo/org/eclipse/swt/graphics/Path.java b/bundles/org.eclipse.swt/Eclipse SWT/cairo/org/eclipse/swt/graphics/Path.java index 044661c468..82457d4e1f 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/cairo/org/eclipse/swt/graphics/Path.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/cairo/org/eclipse/swt/graphics/Path.java @@ -48,6 +48,7 @@ public void addArc(float x, float y, float width, float height, float startAngle public void addPath(Path path) { if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED); + if (path == null) SWT.error(SWT.ERROR_NULL_ARGUMENT); if (path.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT); Cairo.cairo_add_path(handle, path.handle); } diff --git a/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/graphics/Path.java b/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/graphics/Path.java index cc9eedd51a..093455c5ff 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/graphics/Path.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/graphics/Path.java @@ -43,6 +43,7 @@ public void addArc(float x, float y, float width, float height, float startAngle public void addPath(Path path) { if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED); + if (path == null) SWT.error(SWT.ERROR_NULL_ARGUMENT); if (path.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT); OS.CGPathAddPath(handle, null, path.handle); } @@ -96,6 +97,8 @@ float[] point = new float[2]; boolean first; public void addString(String string, float x, float y, Font font) { if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED); + if (font == null) SWT.error(SWT.ERROR_NULL_ARGUMENT); + if (font.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT); int length = string.length(); if (length == 0) return; diff --git a/bundles/org.eclipse.swt/Eclipse SWT/emulated/graphics/org/eclipse/swt/graphics/Path.java b/bundles/org.eclipse.swt/Eclipse SWT/emulated/graphics/org/eclipse/swt/graphics/Path.java index 5358942554..0613f50490 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/emulated/graphics/org/eclipse/swt/graphics/Path.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/emulated/graphics/org/eclipse/swt/graphics/Path.java @@ -38,6 +38,7 @@ public void addArc(float x, float y, float width, float height, float startAngle public void addPath(Path path) { if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED); + if (path == null) SWT.error(SWT.ERROR_NULL_ARGUMENT); if (path.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT); } diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Path.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Path.java index 7c93e017ba..e765072a63 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Path.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Path.java @@ -126,7 +126,7 @@ public void addArc(float x, float y, float width, float height, float startAngle */ public void addPath(Path path) { if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED); - if (path == null) SWT.error(SWT.ERROR_NULL_ARGUMENT); /* McQ added a missing null check. */ + if (path == null) SWT.error(SWT.ERROR_NULL_ARGUMENT); if (path.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT); //TODO - expose connect? Gdip.GraphicsPath_AddPath(handle, path.handle, false); @@ -175,8 +175,8 @@ public void addRectangle(float x, float y, float width, float height) { */ public void addString(String string, float x, float y, Font font) { if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED); - if (font == null) SWT.error(SWT.ERROR_NULL_ARGUMENT); /* McQ added a missing null check. */ - if (font.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT); /* McQ added a missing isDisposed check. */ + if (font == null) SWT.error(SWT.ERROR_NULL_ARGUMENT); + if (font.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT); int length = string.length(); char[] buffer = new char[length]; string.getChars(0, length, buffer, 0); diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Pattern.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Pattern.java index 0c9f6b20d1..9e8f5156d9 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Pattern.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Pattern.java @@ -86,8 +86,8 @@ public Pattern(Device device, Image image) { * @param y1 the y coordinate of the starting corner of the gradient * @param x2 the x coordinate of the ending corner of the gradient * @param y2 the y coordinate of the ending corner of the gradient - * @param foreground the starting color of the gradient - * @param background the ending color of the gradient + * @param color1 the starting color of the gradient + * @param color2 the ending color of the gradient * * @exception IllegalArgumentException <ul> * <li>ERROR_NULL_ARGUMENT - if the device is null and there is no current device, @@ -100,20 +100,20 @@ public Pattern(Device device, Image image) { * * @see #dispose() */ -public Pattern(Device device, float x1, float y1, float x2, float y2, Color foreground, Color background) { +public Pattern(Device device, float x1, float y1, float x2, float y2, Color color1, Color color2) { if (device == null) device = Device.getDevice(); if (device == null) SWT.error(SWT.ERROR_NULL_ARGUMENT); - if (foreground == null) SWT.error(SWT.ERROR_NULL_ARGUMENT); - if (foreground.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT); - if (background == null) SWT.error(SWT.ERROR_NULL_ARGUMENT); - if (background.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT); + if (color1 == null) SWT.error(SWT.ERROR_NULL_ARGUMENT); + if (color1.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT); + if (color2 == null) SWT.error(SWT.ERROR_NULL_ARGUMENT); + if (color2.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT); this.device = device; device.checkGDIP(); //TODO - how about alpha? - int colorRef = foreground.handle; + int colorRef = color1.handle; int rgb = ((colorRef >> 16) & 0xFF) | (colorRef & 0xFF00) | ((colorRef & 0xFF) << 16); int foreColor = Gdip.Color_new(0xFF << 24 | rgb); - colorRef = background.handle; + colorRef = color2.handle; rgb = ((colorRef >> 16) & 0xFF) | (colorRef & 0xFF00) | ((colorRef & 0xFF) << 16); int backColor = Gdip.Color_new(0xFF << 24 | rgb); PointF p1 = new PointF(); |