bug fix for #313

This works for the bug I was experiencing. One way to recreate the problem is to put labels with links which appear near the end of the string so that when the table is scrolled the ranges for links go beyond the bounds of the current attributed string. The links array needs to be reset when the attributed text changes.