fdo#82614: sw: Revert "Simplify code path"

This reverts commit 07c00671443f3f0a2e2e6c3a54c391f040e8fd2b.

The bug is because the check of the GotoHeaderTxt() is inverted.

Actually in the old code it is a bit easier to understand what is intended,
even though it is more verbose, so just revert the commit.