Index: javax/swing/text/Utilities.java =================================================================== RCS file: /cvsroot/classpath/classpath/javax/swing/text/Utilities.java,v retrieving revision 1.12 diff -u -r1.12 Utilities.java --- javax/swing/text/Utilities.java 27 Sep 2005 16:46:21 -0000 1.12 +++ javax/swing/text/Utilities.java 28 Sep 2005 14:44:22 -0000 @@ -408,10 +408,7 @@ public static final int getRowEnd(JTextComponent c, int offs) throws BadLocationException { - Element root = c.getDocument().getDefaultRootElement(); - Element rowElement = root.getElement(root.getElementIndex(offs)); - String text = c.getText(rowElement.getStartOffset(), - rowElement.getEndOffset()); + String text = c.getText(); if (text == null) return -1; @@ -420,7 +417,7 @@ // line as the character at position offs int high = offs + ((text.length() - 1 - offs) / 2); int low = offs; - int oldHigh = text.length(); + int oldHigh = text.length() + 1; while (true) { if (c.modelToView(high).y != c.modelToView(offs).y) @@ -454,10 +451,7 @@ public static final int getRowStart(JTextComponent c, int offs) throws BadLocationException { - Element root = c.getDocument().getDefaultRootElement(); - Element rowElement = root.getElement(root.getElementIndex(offs)); - String text = c.getText(rowElement.getStartOffset(), - rowElement.getEndOffset()); + String text = c.getText(); if (text == null) return -1;