Fix wrongly enabled hyperlink tools with no document loaded
Remove duplicated code, linksInSelection is set later again