diff dwtx/jface/internal/text/revisions/Hunk.d @ 162:1a5b8f8129df

...
author Frank Benoit <benoit@tionex.de>
date Mon, 08 Sep 2008 00:51:37 +0200
parents 3678e4f1a766
children
line wrap: on
line diff
--- a/dwtx/jface/internal/text/revisions/Hunk.d	Wed Aug 27 14:49:30 2008 +0200
+++ b/dwtx/jface/internal/text/revisions/Hunk.d	Mon Sep 08 00:51:37 2008 +0200
@@ -20,15 +20,15 @@
 import dwtx.jface.internal.text.revisions.RevisionPainter; // packageimport
 import dwtx.jface.internal.text.revisions.RevisionSelectionProvider; // packageimport
 
-
 import dwt.dwthelper.utils;
+import tango.text.convert.Format;
 
 import dwtx.core.runtime.Assert;
 
 /**
  * A hunk describes a contiguous range of changed, added or deleted lines. <code>Hunk</code>s are separated by
  * one or more unchanged lines.
- * 
+ *
  * @since 3.3
  */
 public final class Hunk {
@@ -48,7 +48,7 @@
 
     /**
      * Creates a new hunk.
-     * 
+     *
      * @param line the line at which the hunk starts, must be &gt;= 0
      * @param delta the difference in lines compared to the original
      * @param changed the number of changed lines in this hunk, must be &gt;= 0
@@ -65,9 +65,9 @@
      * @see java.lang.Object#toString()
      */
     public override String toString() {
-        return "Hunk [" + line + ">" + changed + (delta < 0 ? "-" : "+") + Math.abs(delta) + "]"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
+        return Format("Hunk [{}>{}{}{}]", line, changed, delta < 0 ? "-" : "+", Math.abs(delta) ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
     }
-    
+
     /*
      * @see java.lang.Object#hashCode()
      */
@@ -83,11 +83,10 @@
     /*
      * @see java.lang.Object#equals(java.lang.Object)
      */
-    public bool equals(Object obj) {
+    public override int opEquals(Object obj) {
         if (obj is this)
             return true;
-        if ( cast(Hunk)obj ) {
-            Hunk other= cast(Hunk) obj;
+        if ( Hunk other= cast(Hunk)obj ) {
             return other.line is this.line && other.delta is this.delta && other.changed is this.changed;
         }
         return false;