# HG changeset patch # User Frank Benoit # Date 1201109794 -3600 # Node ID a3471c255cd218b90e7fa54a16dda966f7497914 # Parent d4b244e1e1aeaff04abaafee098c4532509c5daf bugfixes diff -r d4b244e1e1ae -r a3471c255cd2 dwt/custom/CLabel.d --- a/dwt/custom/CLabel.d Wed Jan 23 01:59:19 2008 +0100 +++ b/dwt/custom/CLabel.d Wed Jan 23 18:36:34 2008 +0100 @@ -828,7 +828,7 @@ System.arraycopy(lines, 0, newLines, 0, lines.length); lines = newLines; } - } while (pos !is -1); + } while (pos !is text.length); return lines; } } diff -r d4b244e1e1ae -r a3471c255cd2 dwt/dnd/Clipboard.d --- a/dwt/dnd/Clipboard.d Wed Jan 23 01:59:19 2008 +0100 +++ b/dwt/dnd/Clipboard.d Wed Jan 23 18:36:34 2008 +0100 @@ -1,4 +1,4 @@ -/******************************************************************************* +/******************************************************************************* * Copyright (c) 2000, 2007 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 @@ -41,15 +41,18 @@ private Display display; - static void* GTKCLIPBOARD; - static void* GTKPRIMARYCLIPBOARD; + private static void* GTKCLIPBOARD; + private static void* GTKPRIMARYCLIPBOARD; private static void* TARGET; - - static this(){ - GTKCLIPBOARD = OS.gtk_clipboard_get( cast(void*)OS.GDK_NONE); - auto primary = OS.gdk_atom_intern("PRIMARY".ptr, false); - GTKPRIMARYCLIPBOARD = OS.gtk_clipboard_get(primary); - TARGET = OS.gdk_atom_intern("TARGETS".ptr, false); + private static bool static_this_completed = false; + private static void static_this(){ + if( !static_this_completed ){ + GTKCLIPBOARD = OS.gtk_clipboard_get( cast(void*)OS.GDK_NONE); + auto primary = OS.gdk_atom_intern("PRIMARY".ptr, false); + GTKPRIMARYCLIPBOARD = OS.gtk_clipboard_get(primary); + TARGET = OS.gdk_atom_intern("TARGETS".ptr, false); + static_this_completed = true; + } } /** @@ -69,6 +72,7 @@ */ public this(Display display) { checkSubclass (); + static_this(); if (display is null) { display = Display.getCurrent(); if (display is null) { @@ -110,7 +114,7 @@ */ protected void checkSubclass () { char[] name = this.classinfo.name; - char[] validName = Clipboard.stringof; + char[] validName = Clipboard.classinfo.name; if ( validName !=/*eq*/ name ) { DND.error (DWT.ERROR_INVALID_SUBCLASS); } diff -r d4b244e1e1ae -r a3471c255cd2 dwt/graphics/TextLayout.d --- a/dwt/graphics/TextLayout.d Wed Jan 23 01:59:19 2008 +0100 +++ b/dwt/graphics/TextLayout.d Wed Jan 23 18:36:34 2008 +0100 @@ -1688,16 +1688,12 @@ * * @param text the new text * - * @exception IllegalArgumentException * @exception DWTException */ public void setText (char[] text) { checkLayout (); - if (text is null) DWT.error(DWT.ERROR_NULL_ARGUMENT); if (text ==/*eq*/this.text) return; freeRuns(); this.text = text; diff -r d4b244e1e1ae -r a3471c255cd2 dwt/graphics/TextStyle.d --- a/dwt/graphics/TextStyle.d Wed Jan 23 01:59:19 2008 +0100 +++ b/dwt/graphics/TextStyle.d Wed Jan 23 18:36:34 2008 +0100 @@ -124,8 +124,8 @@ } else if (style.background !is null) return false; if (font !is null) { if (font != style.font) return false; - } else if (style.font != null) return false; - if (metrics != null || style.metrics !is null) return false; + } else if (style.font !is null) return false; + if (metrics !is null || style.metrics !is null) return false; if (underline !is style.underline) return false; if (strikeout !is style.strikeout) return false; if (rise !is style.rise) return false; diff -r d4b244e1e1ae -r a3471c255cd2 dwt/internal/image/LEDataInputStream.d --- a/dwt/internal/image/LEDataInputStream.d Wed Jan 23 01:59:19 2008 +0100 +++ b/dwt/internal/image/LEDataInputStream.d Wed Jan 23 18:36:34 2008 +0100 @@ -1,4 +1,4 @@ -/******************************************************************************* +/******************************************************************************* * Copyright (c) 2000, 2006 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 @@ -155,7 +155,7 @@ */ public int readInt() { byte[4] buf = void; - host.read(buf); + read(buf); return ((((((buf[3] & 0xFF) << 24) | (buf[2] & 0xFF)) << 16) | (buf[1] & 0xFF)) << 8) | @@ -168,7 +168,7 @@ */ public short readShort() { byte[2] buf = void; - host.read(buf); + read(buf); return cast(short)(((buf[1] & 0xFF) << 8) | (buf[0] & 0xFF)); } diff -r d4b244e1e1ae -r a3471c255cd2 dwt/internal/image/WinBMPFileFormat.d --- a/dwt/internal/image/WinBMPFileFormat.d Wed Jan 23 01:59:19 2008 +0100 +++ b/dwt/internal/image/WinBMPFileFormat.d Wed Jan 23 18:36:34 2008 +0100 @@ -1,4 +1,4 @@ -/******************************************************************************* +/******************************************************************************* * Copyright (c) 2000, 2006 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0