changeset 146:a3471c255cd2

bugfixes
author Frank Benoit <benoit@tionex.de>
date Wed, 23 Jan 2008 18:36:34 +0100
parents d4b244e1e1ae
children 4a1b8869428e
files dwt/custom/CLabel.d dwt/dnd/Clipboard.d dwt/graphics/TextLayout.d dwt/graphics/TextStyle.d dwt/internal/image/LEDataInputStream.d dwt/internal/image/WinBMPFileFormat.d
diffstat 6 files changed, 21 insertions(+), 21 deletions(-) [+]
line wrap: on
line diff
--- 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;
 }
 }
--- 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);
     }
--- 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 <ul>
- *    <li>ERROR_NULL_ARGUMENT - if the text is null</li>
- * </ul>
  * @exception DWTException <ul>
  *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
  * </ul>
  */
 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;
--- 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;
--- 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));
     }
 
--- 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