Bug 116337 - Linked text returned by HYPERLINK getting appended additional text adds it to the anchor AND TO THE LINK as well.
Summary: Linked text returned by HYPERLINK getting appended additional text adds it to...
Status: CLOSED WONTFIX
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
3.3.0 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-03-10 14:35 UTC by Wolfgang Jäger
Modified: 2018-07-11 13:03 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Wolfgang Jäger 2018-03-10 14:35:15 UTC
Steps to reproduce:
In a virgin sheet enter into an arbitrary cell:
=HYPERLINK("https://documentfoundation.org";"The link") & " for you!"

Expexted: Returns the text "The link for you!" where "The link" is linked to the above given URL in the correct way.

Observed: The text "The link for you!" is returned, but linked completely to the nonsense-URL "https://documentfoundation.org for you!" 

It would well be acceptable if appending to text returned by HYPERLINK was disallowed, but, if this was intended, the specification had to state the restriction and Calc should return an error instead of the nonsense.
Comment 1 Regina Henschel 2018-03-10 21:23:32 UTC
6.11.3 HYPERLINK
Semantics: The default for the second argument is the value of the first argument. The second argument value is returned. 
In addition, hosting environments may interpret expressions containing HYPERLINK function calls as calling for an implementation-dependent creation of a hypertext link based on the expression containing the HYPERLINK function calls.

It is not an ODF problem. On one hand you have "implementation-dependent" and on the other hand you have "based on the expression containing the HYPERLINK function calls", which means, that the hyperlink URL can be build from the total expression and not only of the part in the HYPERLINK function.
Comment 2 Wolfgang Jäger 2018-03-11 16:04:36 UTC
(In reply to Regina Henschel from comment #1)
> 6.11.3 HYPERLINK
> Semantics: The default for the second argument is the value of the first
> argument. The second argument value is returned. 
> In addition, hosting environments may interpret expressions containing
> HYPERLINK function calls as calling for an implementation-dependent creation
> of a hypertext link based on the expression containing the HYPERLINK
> function calls.
> 
> It is not an ODF problem. On one hand you have "implementation-dependent"
> and on the other hand you have "based on the expression containing the
> HYPERLINK function calls", which means, that the hyperlink URL can be build
> from the total expression and not only of the part in the HYPERLINK function.

You are right. It's not an issue concerning compliance with ODF.
The actual behaviour is, however, not reasonable. 
WHY should additional parts of text returned by another operand in the formula be considerd to belong to the URL (or similar target expression)? The second parameter is not, after all, and something advetently to be appended to the URL can be placed in the first parameter position. 
Thus I would still call this a bug. It may, however, be seen as feature request / enhancement. It should just be fixed.
Comment 3 Eike Rathke 2018-07-11 13:02:52 UTC
It's odd and not reasonable but that's how Excel does it and how it was specified for compatibility already for OpenOffice.org, see https://www.openoffice.org/specs/calc/compatibility/HyperLinkFunction.sxw

Won't fix.