Created attachment 167402 [details] A text document with macro demonstrating the issue With 7.0.2 and also with 7.0.3: A link like vnd.sun.star.script:Standard.Module1.Main?language=Basic&location=document is correctly shown on mouse over the linked text, but does not work in Writer. Same link created same way in Calc is working as expected. The text of the link passed to HYPERLINK() also gives the working link. See attachments.
Created attachment 167403 [details] Same macro in a spreadsheet document. Link working
Confirmed in: Version: 7.3.0.0.alpha0+ (x64) / LibreOffice Community Build ID: 0aea0cee58fe77a9058217dfdfc3d6a02b29ee2a CPU threads: 6; OS: Windows 10.0 Build 19042; UI render: Skia/Raster; VCL: win Locale: en-US (de_DE); UI: en-US Calc: CL
However, opening the link via context menu works. (Right Click -> Open Hyperlink)
I tried to investigate this error. Here are my findings: For both Calc and Writer the URL will be open in: https://opengrok.libreoffice.org/xref/core/sfx2/source/appl/appopen.cxx?r=5021a10f#1078 The only difference is that the target of the URL is "empty" for Calc and "_blank" for Writer, if you try to open it using CTRL+click. However, if Writer opens the URL via context menu, the target is "empty" as well. Calc will add the "_blank" target, if SHIFT is enabled, which is IMHO wrong: https://opengrok.libreoffice.org/xref/core/sc/source/core/data/global.cxx?r=1b7fc505#810 Writer adds the "_blank" target in: https://opengrok.libreoffice.org/xref/core/sw/source/uibase/wrtsh/wrtsh2.cxx?r=aa818a0b#546, because of the CTRL modifier in: https://opengrok.libreoffice.org/xref/core/sw/source/uibase/docvw/edtwin.cxx?r=216a43bc#4691. Imho, this is not a macro problem, but a problem in the target handling in appopen.cxx and the supported protocols for the "_blank" target.
Created attachment 175975 [details] Exemplifying relevant differences by three insetzed hyperlinks (In reply to Andreas Heinisch from comment #4) > I tried to investigate this error. Here are my findings: > > For both Calc and Writer the URL will be open in: > https://opengrok.libreoffice.org/xref/core/sfx2/source/appl/appopen. > cxx?r=5021a10f#1078 > > The only difference is that the target of the URL is "empty" for Calc and > "_blank" for Writer, ... > Imho, this is not a macro problem, but a problem in the target handling in > appopen.cxx and the supported protocols for the "_blank" target. I can't go the same ways, but would doubt the "... but a problem in the target handling..." as the only background. After all ordinary external links assigned to text portions in Writer are working as expected, and for a link made to call a script, I would expect the target frame irrelevant. A new example exemplifying differences I suppose to be part of the bug's backround is attached as "bug_tdf#138347_example2 .
Created attachment 176454 [details] Event assigned to the Hyperlink Sry for the later reply. The working link has an event attached to it, whereas the not working macro contains only the link to the macro.
However, if I attach a macro to the hyperlink triggering event to the first attachment, the link will be triggered twice if opened using the context menu of the hyperlink.
bump
Did a bit of research once more. Result: The bug was already present in OOo and was never fixed. It continues to exist in AOO (tested with 4.1.7 portable). However, it only takes effect when the option "Ctrl+Click to activate Hyperlink" is set. Users shouldn't be encouraged to reduce security settings. And again: In Calc everything is OK so far. Same in Draw. To be clear: Only the Sub calling protocol vnd.sun.star.sript: is afflicted. Ordinary hyperlinks work as expected.