posRangeToIndexRange

Converts the position range into the index range.