TextRange () { TextRange range = myDelegate.getHighlightRange(); if (range == null) return null; int start = transferOffsetFromTwoside(mySide, range.getStartOffset()); int end = transferOffsetFromTwoside(mySide, range.getEndOffset()); if (start == -1 || end == -1) return null; return new TextRange(start, end); }