classpath-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cp-patches] FYI: Patches for several javax.swing.text files


From: Anthony Balkissoon
Subject: Re: [cp-patches] FYI: Patches for several javax.swing.text files
Date: Thu, 05 Jan 2006 18:55:44 -0500

On Thu, 2006-01-05 at 21:36 +0100, Mark Wielaard wrote:
> Hi Tony,
> > +        Document doc = textComponent.getDocument();
> > +        if (doc != null)
> > +          this.dot = Math.min(dot, doc.getLength());
> > +        this.dot = Math.max(dot, 0);

> There seems to be some confusion here between dot the parameter and
> this.dot. if doc != null you probably want to set the parameter dot to
> Math.min(dot,etc) since you will override this.dot immediately after
> that assignment.

Thanks Mark, this is fixed as follows:

2006-01-05  Anthony Balkissoon  <address@hidden>

        * javax/swing/text/DefaultCaret.java:
        (setDot): Fixed paramater to Math.max to be this.dot and not the 
        parameter dot.


RCS
file: /cvsroot/classpath/classpath/javax/swing/text/DefaultCaret.java,v
retrieving revision 1.27
diff -u -r1.27 DefaultCaret.java
--- javax/swing/text/DefaultCaret.java  5 Jan 2006 20:15:34 -0000
1.27
+++ javax/swing/text/DefaultCaret.java  5 Jan 2006 23:53:08 -0000
@@ -833,7 +833,7 @@
         Document doc = textComponent.getDocument();
         if (doc != null)
           this.dot = Math.min(dot, doc.getLength());
-        this.dot = Math.max(dot, 0);
+        this.dot = Math.max(this.dot, 0);
         this.mark = dot;
         handleHighlight();
         adjustVisibility(this);

Attachment: DefaultCaretSetDotFix.diff
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]