Resolves: fdo#84588 loop in TableInfo::getNextNode

Change-Id: I5bb44dc94041c3b3cd9d80ba125594a48c9c921f
(cherry picked from commit f0859c4eae0f567393811c308074723329f1faab)
Reviewed-on: https://gerrit.libreoffice.org/11828
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>