diff dwt/widgets/Display.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 8bca790583c3
children c0d810de7093
line wrap: on
line diff
--- a/dwt/widgets/Display.d	Sun Jun 08 15:11:48 2008 +0200
+++ b/dwt/widgets/Display.d	Sun Jun 15 22:32:20 2008 +0200
@@ -44,7 +44,6 @@
 import dwt.widgets.Widget;
 
 import tango.stdc.string;
-import tango.stdc.stringz;
 import dwt.dwthelper.utils;
 import dwt.dwthelper.Runnable;
 
@@ -1597,9 +1596,6 @@
  * @param key the name of the property
  * @return the value of the property or null if it has not been set
  *
- * @exception IllegalArgumentException <ul>
- *    <li>ERROR_NULL_ARGUMENT - if the key is null</li>
- * </ul>
  * @exception DWTException <ul>
  *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
  *    <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
@@ -1610,7 +1606,8 @@
  */
 public Object getData (String key) {
     checkDevice ();
-    if (key is null) error (DWT.ERROR_NULL_ARGUMENT);
+    // DWT extension: allow null for zero length string
+    //if (key is null) error (DWT.ERROR_NULL_ARGUMENT);
     if (key.equals (DISPATCH_EVENT_KEY)) {
         return new ArrayWrapperInt(dispatchEvents);
     }
@@ -3522,9 +3519,6 @@
  * @param key the name of the property
  * @param value the new value for the property
  *
- * @exception IllegalArgumentException <ul>
- *    <li>ERROR_NULL_ARGUMENT - if the key is null</li>
- * </ul>
  * @exception DWTException <ul>
  *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
  *    <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
@@ -3535,9 +3529,10 @@
  */
 public void setData (String key, Object value) {
     checkDevice ();
-    if (key is null) error (DWT.ERROR_NULL_ARGUMENT);
-
-    if (key==/*eq*/ DISPATCH_EVENT_KEY) {
+    // DWT extension: allow null for zero length string
+    //if (key is null) error (DWT.ERROR_NULL_ARGUMENT);
+
+    if (key.equals (DISPATCH_EVENT_KEY)) {
         ArrayWrapperInt wrappedValue;
         if (value is null || (null !is (wrappedValue=cast(ArrayWrapperInt)value))) {
             dispatchEvents = wrappedValue.array;