Range selection ending fix

Removed time signature from selection if not followed by chordrest in selection.
Fixed range box to not include bar lines and time signatures if not followed by a chordrest.
The Segment* s is undefined in your snippet at return s.

I don't know if this much clearer. It is a bit more compact. If we are going this way, why not move the loop body to the last part of the for loop? We would remove the need of the body fully.

    Segment* s = segment()->next1MM(types);
    for (s; s && (s->tick() < tick() + actualTicks()); s = s->next1MM(types));
    return s;