fixed previous patch for cases where the textnode has no parent (odd
but happens when building snippets, particularly in one ADWClient
test)

re ADWolf:#1197