The code is mostly unused as far as I can see...
Yes, you are correct.
But then, why was the '~' in there in the first place? Can anyone tell?
And there is another difference below: for empty strings, PartDocument::textWord() was returned.
I cannot tell whether this change in behavior will do any bad, since my knowledge of KDevelop mainly lies in KTextEditor :^)