# HG changeset patch # User Frank Benoit # Date 1218114969 -7200 # Node ID 3dfa75c74ed22aaeb829a7f6242eee3bbf62bbf1 # Parent 695802b523c045848d5edf79af60d862bc910c49# Parent b0bd1789106b740ab8adeea06dcf849e29dde9e4 merge diff -r b0bd1789106b -r 3dfa75c74ed2 dwt/dwthelper/WeakHashMap.d --- a/dwt/dwthelper/WeakHashMap.d Wed Aug 06 18:29:44 2008 -0700 +++ b/dwt/dwthelper/WeakHashMap.d Thu Aug 07 15:16:09 2008 +0200 @@ -46,12 +46,12 @@ gcLock = ClassInfo.find( "gcx.GCLock" ); } - public void add (Object key, Object element){ + public void put (Object key, Object element){ auto k = new Ref(key); rt_attachDisposeEvent(key, &unhook); data[ k ] = element; } - public void removeKey (Object key){ + public void remove (Object key){ scope k = new Ref(key); if( auto p = k in data ){ data.remove( k ); diff -r b0bd1789106b -r 3dfa75c74ed2 dwt/dwthelper/utils.d --- a/dwt/dwthelper/utils.d Wed Aug 06 18:29:44 2008 -0700 +++ b/dwt/dwthelper/utils.d Thu Aug 07 15:16:09 2008 +0200 @@ -845,12 +845,6 @@ } } -interface Enumeration { - public bool hasMoreElements(); - public Object nextElement(); -} - - template arraycast(T) { T[] arraycast(U) (U[] u) { static if ( @@ -894,6 +888,35 @@ return res; } +String[] stringArrayFromObject( Object obj ){ + if( auto wrapper = cast(ArrayWrapperString2)obj ){ + return wrapper.array; + } + if( auto wrapper = cast(ArrayWrapperObject)obj ){ + String[] res = new String[ wrapper.array.length ]; + foreach( idx, o; wrapper.array ){ + if( auto swrapper = cast(ArrayWrapperString) o ){ + res[idx] = swrapper.array; + } + } + return res; + } + assert( obj is null ); // if not null, it was the wrong type + return null; +} + +T[] arrayFromObject(T)( Object obj ){ + if( auto wrapper = cast(ArrayWrapperObject)obj ){ + T[] res = new T[ wrapper.array.length ]; + foreach( idx, o; wrapper.array ){ + res[idx] = cast(T)o; + } + return res; + } + assert( obj is null ); // if not null, it was the wrong type + return null; +} + bool ArrayEquals(T)( T[] a, T[] b ){ if( a.length !is b.length ){ @@ -921,24 +944,6 @@ return true; } -class Arrays{ - public static bool equals(Object[] a, Object[] b){ - if( a.length !is b.length ){ - return false; - } - for( int i = 0; i < a.length; i++ ){ - if( a[i] is null && b[i] is null ){ - continue; - } - if( a[i] !is null && b[i] !is null && a[i] == b[i] ){ - continue; - } - return false; - } - return true; - } -} - int SeqIndexOf(T)( tango.util.collection.model.Seq.Seq!(T) s, T src ){ int idx; foreach( e; s ){ diff -r b0bd1789106b -r 3dfa75c74ed2 dwt/internal/mozilla/nsEmbedString2.d diff -r b0bd1789106b -r 3dfa75c74ed2 dwt/internal/mozilla/nsIDownload.d diff -r b0bd1789106b -r 3dfa75c74ed2 dwt/internal/mozilla/nsIInputStream.d diff -r b0bd1789106b -r 3dfa75c74ed2 dwt/internal/mozilla/nsILocalFile.d diff -r b0bd1789106b -r 3dfa75c74ed2 dwt/internal/mozilla/nsIProgressDialog.d diff -r b0bd1789106b -r 3dfa75c74ed2 dwt/internal/mozilla/nsISupports.d diff -r b0bd1789106b -r 3dfa75c74ed2 dwt/internal/mozilla/nsStringAPI.d diff -r b0bd1789106b -r 3dfa75c74ed2 dwt/internal/mozilla/nsXPCOM.d