diff options
Diffstat (limited to 'libjava/classpath/java/awt/font/TextHitInfo.java')
-rw-r--r-- | libjava/classpath/java/awt/font/TextHitInfo.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libjava/classpath/java/awt/font/TextHitInfo.java b/libjava/classpath/java/awt/font/TextHitInfo.java index 2b23e1963cd..f6fee1addae 100644 --- a/libjava/classpath/java/awt/font/TextHitInfo.java +++ b/libjava/classpath/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) |