diff options
author | Tania Bento <tbento@redhat.com> | 2006-11-24 21:32:03 +0000 |
---|---|---|
committer | Tania Bento <tbento@redhat.com> | 2006-11-24 21:32:03 +0000 |
commit | a10e1e8fd32383f5eb21aa2250cc45878a69da9d (patch) | |
tree | c65c1a15080fdb368e41c349338cc074743f5495 /java | |
parent | 5a348add86cf8b31de3944d9053d9c870947c5d9 (diff) | |
download | classpath-a10e1e8fd32383f5eb21aa2250cc45878a69da9d.tar.gz |
2006-11-24 Tania Bento <tbento@redhat.com>
* java/awt/font/TextHitInfo.java
(equals(TextHitInfo)): If TextHitInfo parameter is null, return false.
(beforeOffset): Decreased first parameter by 1.
Diffstat (limited to 'java')
-rw-r--r-- | java/awt/font/TextHitInfo.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/java/awt/font/TextHitInfo.java b/java/awt/font/TextHitInfo.java index 2b23e1963..f6fee1add 100644 --- a/java/awt/font/TextHitInfo.java +++ b/java/awt/font/TextHitInfo.java @@ -81,6 +81,9 @@ public final class TextHitInfo public boolean equals(TextHitInfo hitInfo) { + if (hitInfo == null) + return false; + return (charIndex == hitInfo.getCharIndex ()) && (leadingEdge == hitInfo.isLeadingEdge ()); } @@ -97,7 +100,7 @@ public final class TextHitInfo public static TextHitInfo beforeOffset(int offset) { - return new TextHitInfo (offset, false); + return new TextHitInfo ((offset - 1), false); } public static TextHitInfo afterOffset(int offset) |