int () { int endSegmentNumber = getTemplate().getEndSegmentNumber(); if (endSegmentNumber < 0 && getSelectionBeforeTemplate() == null) { endSegmentNumber = getTemplate().getVariableSegmentNumber(Template.SELECTION); } return endSegmentNumber; }