diff dwt/custom/CCombo.d @ 255:5a30aa9820f3

removed tango.stdc.stringz imports and allow null for arrays and string arguments.
author Frank Benoit <benoit@tionex.de>
date Sun, 15 Jun 2008 22:32:20 +0200
parents ce446666f5a2
children c0d810de7093
line wrap: on
line diff
--- a/dwt/custom/CCombo.d	Sun Jun 08 15:11:48 2008 +0200
+++ b/dwt/custom/CCombo.d	Sun Jun 15 22:32:20 2008 +0200
@@ -192,9 +192,6 @@
  *
  * @param string the new item
  *
- * @exception IllegalArgumentException <ul>
- *    <li>ERROR_NULL_ARGUMENT - if the string is null</li>
- * </ul>
  * @exception DWTException <ul>
  *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
  *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
@@ -204,7 +201,8 @@
  */
 public void add (String string) {
     checkWidget();
-    if (string is null) DWT.error (DWT.ERROR_NULL_ARGUMENT);
+    // DWT extension: allow null for zero length string
+    //if (string is null) DWT.error (DWT.ERROR_NULL_ARGUMENT);
     list.add (string);
 }
 /**
@@ -220,7 +218,6 @@
  * @param index the index for the item
  *
  * @exception IllegalArgumentException <ul>
- *    <li>ERROR_NULL_ARGUMENT - if the string is null</li>
  *    <li>ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the list (inclusive)</li>
  * </ul>
  * @exception DWTException <ul>
@@ -232,7 +229,8 @@
  */
 public void add (String string, int index) {
     checkWidget();
-    if (string is null) DWT.error (DWT.ERROR_NULL_ARGUMENT);
+    // DWT extension: allow null for zero length string
+    //if (string is null) DWT.error (DWT.ERROR_NULL_ARGUMENT);
     list.add (string, index);
 }
 /**
@@ -869,9 +867,6 @@
  * @param string the search item
  * @return the index of the item
  *
- * @exception IllegalArgumentException <ul>
- *    <li>ERROR_NULL_ARGUMENT - if the string is null</li>
- * </ul>
  * @exception DWTException <ul>
  *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
  *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
@@ -879,7 +874,8 @@
  */
 public int indexOf (String string) {
     checkWidget ();
-    if (string is null) DWT.error (DWT.ERROR_NULL_ARGUMENT);
+    // DWT extension: allow null for zero length string
+    //if (string is null) DWT.error (DWT.ERROR_NULL_ARGUMENT);
     return list.indexOf (string);
 }
 /**
@@ -893,9 +889,6 @@
  * @param start the zero-relative index at which to begin the search
  * @return the index of the item
  *
- * @exception IllegalArgumentException <ul>
- *    <li>ERROR_NULL_ARGUMENT - if the string is null</li>
- * </ul>
  * @exception DWTException <ul>
  *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
  *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
@@ -903,7 +896,8 @@
  */
 public int indexOf (String string, int start) {
     checkWidget ();
-    if (string is null) DWT.error (DWT.ERROR_NULL_ARGUMENT);
+    // DWT extension: allow null for zero length string
+    //if (string is null) DWT.error (DWT.ERROR_NULL_ARGUMENT);
     return list.indexOf (string, start);
 }
 
@@ -1237,7 +1231,6 @@
  * @param string the item to remove
  *
  * @exception IllegalArgumentException <ul>
- *    <li>ERROR_NULL_ARGUMENT - if the string is null</li>
  *    <li>ERROR_INVALID_ARGUMENT - if the string is not found in the list</li>
  * </ul>
  * @exception DWTException <ul>
@@ -1247,7 +1240,8 @@
  */
 public void remove (String string) {
     checkWidget();
-    if (string is null) DWT.error (DWT.ERROR_NULL_ARGUMENT);
+    // DWT extension: allow null for zero length string
+    //if (string is null) DWT.error (DWT.ERROR_NULL_ARGUMENT);
     list.remove (string);
 }
 /**
@@ -1421,7 +1415,6 @@
  *
  * @exception IllegalArgumentException <ul>
  *    <li>ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the list minus 1 (inclusive)</li>
- *    <li>ERROR_NULL_ARGUMENT - if the string is null</li>
  * </ul>
  * @exception DWTException <ul>
  *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
@@ -1438,7 +1431,6 @@
  * @param items the array of items
  *
  * @exception IllegalArgumentException <ul>
- *    <li>ERROR_NULL_ARGUMENT - if the items array is null</li>
  *    <li>ERROR_INVALID_ARGUMENT - if an item in the items array is null</li>
  * </ul>
  * @exception DWTException <ul>
@@ -1530,9 +1522,6 @@
  *
  * @param string the new text
  *
- * @exception IllegalArgumentException <ul>
- *    <li>ERROR_NULL_ARGUMENT - if the string is null</li>
- * </ul>
  * @exception DWTException <ul>
  *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
  *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
@@ -1540,7 +1529,8 @@
  */
 public void setText (String string) {
     checkWidget();
-    if (string is null) DWT.error (DWT.ERROR_NULL_ARGUMENT);
+    // DWT extension: allow null for zero length string
+    //if (string is null) DWT.error (DWT.ERROR_NULL_ARGUMENT);
     int index = list.indexOf (string);
     if (index is -1) {
         list.deselectAll ();