fdo#86750 RTF import: fix table of contents links

(cherry picked from commit 4517c94000153eab6c034ea548698953dd93f794)

Change-Id: I0f3d35a0e64c9ce5646fa63eda317bee42de5540
Reviewed-on: https://gerrit.libreoffice.org/13372
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>