changeset 195:e0ffca35fe59

Fix: more ==/is
author Frank Benoit <benoit@tionex.de>
date Thu, 06 Mar 2008 10:08:53 +0100
parents b6bee07cfc0b
children 91610024165a
files dwt/accessibility/AccessibleObject.d dwt/graphics/ImageLoader.d dwt/graphics/Region.d dwt/layout/FormAttachment.d dwt/printing/PrintDialog.d dwt/printing/Printer.d
diffstat 6 files changed, 13 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/dwt/accessibility/AccessibleObject.d	Thu Mar 06 09:59:42 2008 +0100
+++ b/dwt/accessibility/AccessibleObject.d	Thu Mar 06 10:08:53 2008 +0100
@@ -863,7 +863,7 @@
                 }
                 case ATK.ATK_TEXT_BOUNDARY_LINE_START: {
                     int lineStart1 = locate( text, '\n' );
-                    if( lineStart1 == text.length ) lineStart1 = -1;
+                    if( lineStart1 is text.length ) lineStart1 = -1;
                     if (lineStart1 is -1) {
                         startBounds = endBounds = length;
                         break;
@@ -875,7 +875,7 @@
                     }
                     startBounds = lineStart1;
                     int lineStart2 = locate( text, '\n' );
-                    if( lineStart2 == text.length ) lineStart2 = -1;
+                    if( lineStart2 is text.length ) lineStart2 = -1;
                     if (lineStart2 is -1) {
                         endBounds = length;
                         break;
--- a/dwt/graphics/ImageLoader.d	Thu Mar 06 09:59:42 2008 +0100
+++ b/dwt/graphics/ImageLoader.d	Thu Mar 06 10:08:53 2008 +0100
@@ -293,7 +293,7 @@
  */
 public void removeImageLoaderListener(ImageLoaderListener listener) {
     if (listener is null) DWT.error (DWT.ERROR_NULL_ARGUMENT);
-    if (imageLoaderListeners.length == 0 ) return;
+    if (imageLoaderListeners.length is 0 ) return;
     tango.core.Array.remove( imageLoaderListeners, listener, delegate bool(ImageLoaderListener l1, ImageLoaderListener l2 ){ return l1 is l2; });
 }
 
--- a/dwt/graphics/Region.d	Thu Mar 06 09:59:42 2008 +0100
+++ b/dwt/graphics/Region.d	Thu Mar 06 10:08:53 2008 +0100
@@ -394,7 +394,7 @@
     gdkRect.y = y;
     gdkRect.width = width;
     gdkRect.height = height;
-    return OS.gdk_region_rect_in(handle, gdkRect) != OS.GDK_OVERLAP_RECTANGLE_OUT;
+    return OS.gdk_region_rect_in(handle, gdkRect) !is OS.GDK_OVERLAP_RECTANGLE_OUT;
 }
 /**
  * Returns <code>true</code> if the given rectangle intersects
--- a/dwt/layout/FormAttachment.d	Thu Mar 06 09:59:42 2008 +0100
+++ b/dwt/layout/FormAttachment.d	Thu Mar 06 10:08:53 2008 +0100
@@ -185,7 +185,7 @@
  * @param offset the offset of the side from the position
  */
 public this (int numerator, int denominator, int offset) {
-    if (denominator == 0) DWT.error (DWT.ERROR_CANNOT_BE_ZERO);
+    if (denominator is 0) DWT.error (DWT.ERROR_CANNOT_BE_ZERO);
     this.numerator = numerator;
     this.denominator = denominator;
     this.offset = offset;
@@ -244,7 +244,7 @@
         m = n;
         n = temp;
     }
-    while (n != 0){
+    while (n !is 0){
         temp = m;
         m = n;
         n = temp % n;
@@ -283,12 +283,12 @@
 }
 
 int solveX (int value) {
-    if (denominator == 0) DWT.error (DWT.ERROR_CANNOT_BE_ZERO);
+    if (denominator is 0) DWT.error (DWT.ERROR_CANNOT_BE_ZERO);
     return ((numerator * value) / denominator) + offset;
 }
 
 int solveY (int value) {
-    if (numerator == 0) DWT.error (DWT.ERROR_CANNOT_BE_ZERO);
+    if (numerator is 0) DWT.error (DWT.ERROR_CANNOT_BE_ZERO);
     return (value - offset) * denominator / numerator;
 }
 
@@ -299,7 +299,7 @@
  * @return a string representation of the FormAttachment
  */
 public override char[] toString () {
-    char[] string = control != null ? control.toString () : Format( "{}/{}", numerator, denominator );
+    char[] string = control !is null ? control.toString () : Format( "{}/{}", numerator, denominator );
     return Format("{{y = ({})x + {}}", string, ( offset >= 0 ? Format(")x + {}", offset ) : Format( ")x - {}", -offset)));
 }
 
--- a/dwt/printing/PrintDialog.d	Thu Mar 06 09:59:42 2008 +0100
+++ b/dwt/printing/PrintDialog.d	Thu Mar 06 10:08:53 2008 +0100
@@ -299,7 +299,7 @@
                     default:
                 }
 
-                printToFile = ( data.name ==/*eq*/ "Print to File" ); //$NON-NLS-1$
+                printToFile = ( data.name.equals("Print to File")); //$NON-NLS-1$
                 if (printToFile) {
                     auto address = OS.gtk_print_settings_get(settings, OS.GTK_PRINT_SETTINGS_OUTPUT_URI.ptr);
                     data.fileName = tango.stdc.stringz.fromStringz( address).dup;
--- a/dwt/printing/Printer.d	Thu Mar 06 09:59:42 2008 +0100
+++ b/dwt/printing/Printer.d	Thu Mar 06 10:08:53 2008 +0100
@@ -103,7 +103,7 @@
     * which means the event loop never ends. The fix is to check to see if the driver
     * is of type Lpr, and stop the enumeration, which exits the event loop.
     */
-    if (printerList[length_].driver ==/*eq*/ GTK_LPR_BACKEND) return 1;
+    if (printerList[length_].driver.equals(GTK_LPR_BACKEND)) return 1;
     return 0;
 }
 
@@ -144,7 +144,7 @@
 }
 int GtkPrinterFunc_FindNamedPrinter (GtkPrinter* printer, void* user_data) {
     PrinterData pd = printerDataFromGtkPrinter(printer);
-    if (pd.driver ==/*eq*/data.driver && pd.name ==/*eq*/ data.name ) {
+    if (pd.driver.equals(data.driver) && pd.name.equals(data.name)) {
         this.printer = printer;
         OS.g_object_ref(printer);
         return 1;
@@ -707,7 +707,7 @@
         char* buffer = tango.stdc.stringz.toStringz( data.fileName );
         OS.gtk_print_settings_set(settings, OS.GTK_PRINT_SETTINGS_OUTPUT_URI.ptr, buffer);
     }
-    if (data.driver ==/*eq*/ "GtkPrintBackendFile" && data.name ==/*eq*/ "Print to File" ) { //$NON-NLS-1$ //$NON-NLS-2$
+    if (data.driver.equals("GtkPrintBackendFile") && data.name.equals("Print to File")) { //$NON-NLS-1$ //$NON-NLS-2$
         char* buffer = tango.stdc.stringz.toStringz( data.fileName );
         OS.gtk_print_settings_set(settings, OS.GTK_PRINT_SETTINGS_OUTPUT_URI.ptr, buffer);
     }