public int getEndLogicalLine() {
    checkEnd();
    setNextLocation();
    return myNextLocation.atEnd() ? Math.max(0, myDocument.getLineCount() - 1)
                                  : myNextLocation.logicalLine - (myNextLocation.softWrap == myLocation.softWrap ? 2 : 1);
  }
public int getEndLogicalLine()