changeset 256:8d1948844918

Allow null strings and arrays
author Frank Benoit <benoit@tionex.de>
date Fri, 20 Jun 2008 15:03:54 +0200
parents 5a30aa9820f3
children cc1d3de0e80b
files dwt/graphics/GC.d
diffstat 1 files changed, 6 insertions(+), 24 deletions(-) [+]
line wrap: on
line diff
--- a/dwt/graphics/GC.d	Sun Jun 15 22:32:20 2008 +0200
+++ b/dwt/graphics/GC.d	Fri Jun 20 15:03:54 2008 +0200
@@ -1307,16 +1307,14 @@
  *
  * @param pointArray an array of alternating x and y values which are the vertices of the polygon
  *
- * @exception IllegalArgumentException <ul>
- *    <li>ERROR_NULL_ARGUMENT if pointArray is null</li>
- * </ul>
  * @exception DWTException <ul>
  *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
  * </ul>
  */
 public void drawPolygon(int[] pointArray) {
     if (handle is null) DWT.error(DWT.ERROR_GRAPHIC_DISPOSED);
-    if (pointArray is null) DWT.error(DWT.ERROR_NULL_ARGUMENT);
+    // DWT externsion: allow null array
+    //if (pointArray is null) DWT.error(DWT.ERROR_NULL_ARGUMENT);
     checkGC(DRAW);
     auto cairo = data.cairo;
     if (cairo !is null) {
@@ -1337,16 +1335,14 @@
  *
  * @param pointArray an array of alternating x and y values which are the corners of the polyline
  *
- * @exception IllegalArgumentException <ul>
- *    <li>ERROR_NULL_ARGUMENT - if the point array is null</li>
- * </ul>
  * @exception DWTException <ul>
  *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
  * </ul>
  */
 public void drawPolyline(int[] pointArray) {
     if (handle is null) DWT.error(DWT.ERROR_GRAPHIC_DISPOSED);
-    if (pointArray is null) DWT.error(DWT.ERROR_NULL_ARGUMENT);
+    // DWT externsion: allow null array
+    //if (pointArray is null) DWT.error(DWT.ERROR_NULL_ARGUMENT);
     checkGC(DRAW);
     auto cairo = data.cairo;
     if (cairo !is null) {
@@ -1530,9 +1526,6 @@
  * @param x the x coordinate of the top left corner of the rectangular area where the str is to be drawn
  * @param y the y coordinate of the top left corner of the rectangular area where the str is to be drawn
  *
- * @exception IllegalArgumentException <ul>
- *    <li>ERROR_NULL_ARGUMENT - if the str is null</li>
- * </ul>
  * @exception DWTException <ul>
  *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
  * </ul>
@@ -1553,9 +1546,6 @@
  * @param y the y coordinate of the top left corner of the rectangular area where the str is to be drawn
  * @param isTransparent if <code>true</code> the background will be transparent, otherwise it will be opaque
  *
- * @exception IllegalArgumentException <ul>
- *    <li>ERROR_NULL_ARGUMENT - if the str is null</li>
- * </ul>
  * @exception DWTException <ul>
  *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
  * </ul>
@@ -1575,9 +1565,6 @@
  * @param x the x coordinate of the top left corner of the rectangular area where the text is to be drawn
  * @param y the y coordinate of the top left corner of the rectangular area where the text is to be drawn
  *
- * @exception IllegalArgumentException <ul>
- *    <li>ERROR_NULL_ARGUMENT - if the str is null</li>
- * </ul>
  * @exception DWTException <ul>
  *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
  * </ul>
@@ -1599,9 +1586,6 @@
  * @param y the y coordinate of the top left corner of the rectangular area where the text is to be drawn
  * @param isTransparent if <code>true</code> the background will be transparent, otherwise it will be opaque
  *
- * @exception IllegalArgumentException <ul>
- *    <li>ERROR_NULL_ARGUMENT - if the str is null</li>
- * </ul>
  * @exception DWTException <ul>
  *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
  * </ul>
@@ -1639,16 +1623,14 @@
  * @param y the y coordinate of the top left corner of the rectangular area where the text is to be drawn
  * @param flags the flags specifying how to process the text
  *
- * @exception IllegalArgumentException <ul>
- *    <li>ERROR_NULL_ARGUMENT - if the str is null</li>
- * </ul>
  * @exception DWTException <ul>
  *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
  * </ul>
  */
 public void drawText (String str, int x, int y, int flags) {
     if (handle is null) DWT.error(DWT.ERROR_GRAPHIC_DISPOSED);
-    if (str is null) DWT.error(DWT.ERROR_NULL_ARGUMENT);
+    // DWT extension: allow null string
+    //if (str is null) DWT.error(DWT.ERROR_NULL_ARGUMENT);
     if (str.length is 0) return;
     auto cairo = data.cairo;
     if (cairo !is null) {