# HG changeset patch # User Frank Benoit # Date 1213972056 -7200 # Node ID 43b41c7fe84a4099f99fa56569615f17986e9593 # Parent efe25e7c8a96bad02a95f1bab3ce662215bb7ca9 work on allow null strings and arrays diff -r efe25e7c8a96 -r 43b41c7fe84a dwt/graphics/GC.d --- a/dwt/graphics/GC.d Fri Jun 20 01:29:54 2008 +0200 +++ b/dwt/graphics/GC.d Fri Jun 20 16:27:36 2008 +0200 @@ -1798,16 +1798,14 @@ * * @param pointArray an array of alternating x and y values which are the vertices of the polygon * - * @exception IllegalArgumentException * @exception DWTException */ 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 extension: allow null array + //if (pointArray is null) DWT.error(DWT.ERROR_NULL_ARGUMENT); checkGC(DRAW); auto gdipGraphics = data.gdipGraphics; if (gdipGraphics !is null) { @@ -1843,16 +1841,14 @@ * * @param pointArray an array of alternating x and y values which are the corners of the polyline * - * @exception IllegalArgumentException * @exception DWTException */ 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 gdipGraphics = data.gdipGraphics; if (gdipGraphics !is null) { @@ -2091,9 +2087,6 @@ * @param x the x coordinate of the top left corner of the rectangular area where the string is to be drawn * @param y the y coordinate of the top left corner of the rectangular area where the string is to be drawn * - * @exception IllegalArgumentException * @exception DWTException @@ -2115,16 +2108,14 @@ * @param y the y coordinate of the top left corner of the rectangular area where the string is to be drawn * @param isTransparent if true the background will be transparent, otherwise it will be opaque * - * @exception IllegalArgumentException * @exception DWTException */ public void drawString (String string, int x, int y, bool isTransparent) { if (handle is null) DWT.error(DWT.ERROR_GRAPHIC_DISPOSED); - if (string is null) DWT.error(DWT.ERROR_NULL_ARGUMENT); + // DWT extension: allow null string + //if (string is null) DWT.error(DWT.ERROR_NULL_ARGUMENT); // TCHAR buffer = new TCHAR (getCodePage(), string, false); wchar[] wstr = StrToWCHARs( string ); int length_ = wstr.length; @@ -2247,9 +2238,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 * @exception DWTException @@ -2271,9 +2259,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 true the background will be transparent, otherwise it will be opaque * - * @exception IllegalArgumentException * @exception DWTException @@ -2311,16 +2296,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 * @exception DWTException */ public void drawText (String string, int x, int y, int flags) { if (handle is null) DWT.error(DWT.ERROR_GRAPHIC_DISPOSED); - if (string is null) DWT.error(DWT.ERROR_NULL_ARGUMENT); + // DWT extension: allow null string + //if (string is null) DWT.error(DWT.ERROR_NULL_ARGUMENT); if (string.length is 0) return; auto gdipGraphics = data.gdipGraphics; if (gdipGraphics !is null) { @@ -2771,9 +2754,6 @@ * * @param pointArray an array of alternating x and y values which are the vertices of the polygon * - * @exception IllegalArgumentException * @exception DWTException @@ -2782,7 +2762,8 @@ */ public void fillPolygon(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(FILL); if (data.gdipGraphics !is null) { int mode = OS.GetPolyFillMode(handle) is OS.WINDING ? Gdip.FillModeWinding : Gdip.FillModeAlternate; @@ -4736,16 +4717,14 @@ * @param string the string to measure * @return a point containing the extent of the string * - * @exception IllegalArgumentException * @exception DWTException */ public Point stringExtent(String string) { if (handle is null) DWT.error(DWT.ERROR_GRAPHIC_DISPOSED); - if (string is null) DWT.error (DWT.ERROR_NULL_ARGUMENT); + // DWT externsion: allow null string + //if (string is null) DWT.error (DWT.ERROR_NULL_ARGUMENT); checkGC(FONT); int length_ = string.length; if (data.gdipGraphics !is null) { diff -r efe25e7c8a96 -r 43b41c7fe84a dwt/program/Program.d --- a/dwt/program/Program.d Fri Jun 20 01:29:54 2008 +0200 +++ b/dwt/program/Program.d Fri Jun 20 16:27:36 2008 +0200 @@ -74,12 +74,10 @@ * @param extension the program extension * @return the program or null * - * @exception IllegalArgumentException */ public static Program findProgram (String extension) { - if (extension is null) DWT.error (DWT.ERROR_NULL_ARGUMENT); + // DWT extension: allow null string + //if (extension is null) DWT.error (DWT.ERROR_NULL_ARGUMENT); if (extension.length is 0) return null; if (extension.charAt (0) !is '.') extension = "." ~ extension; //$NON-NLS-1$ /* Use the character encoding for the default locale */ diff -r efe25e7c8a96 -r 43b41c7fe84a dwt/widgets/Button.d --- a/dwt/widgets/Button.d Fri Jun 20 01:29:54 2008 +0200 +++ b/dwt/widgets/Button.d Fri Jun 20 16:27:36 2008 +0200 @@ -1024,7 +1024,8 @@ */ /*public*/ void setMessage (String message) { checkWidget (); - if (message is null) error (DWT.ERROR_NULL_ARGUMENT); + // DWT externsion: allow null string + //if (message is null) error (DWT.ERROR_NULL_ARGUMENT); this.message = message; if (OS.COMCTL32_VERSION >= OS.VERSION (6, 1)) { if ((style & DWT.COMMAND) !is 0) { @@ -1109,9 +1110,6 @@ *

* @param string the new text * - * @exception IllegalArgumentException * @exception DWTException