Fix ticket #9224: text overflows through adjacent insets

The logic of Row::shortenIfNeeded is completely changed to look at the row from the start and not the end. This leads to clearer code.