[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [cp-patches] FYI: Patches for several javax.swing.text files
From: |
Mark Wielaard |
Subject: |
Re: [cp-patches] FYI: Patches for several javax.swing.text files |
Date: |
Thu, 05 Jan 2006 21:36:46 +0100 |
Hi Tony,
On Thu, 2006-01-05 at 15:16 -0500, Anthony Balkissoon wrote:
> diff -u -r1.26 DefaultCaret.java
> --- javax/swing/text/DefaultCaret.java 22 Nov 2005 16:10:27
> -0000 1.26
> +++ javax/swing/text/DefaultCaret.java 5 Jan 2006 20:13:58 -0000
> @@ -829,9 +829,12 @@
> public void setDot(int dot)
> {
> if (dot >= 0)
> - {
> + {
> + Document doc = textComponent.getDocument();
> + if (doc != null)
> + this.dot = Math.min(dot, doc.getLength());
> + this.dot = Math.max(dot, 0);
> this.mark = dot;
> - this.dot = dot;
> handleHighlight();
> adjustVisibility(this);
> appear();
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.
Cheers,
Mark
signature.asc
Description: This is a digitally signed message part