Bug 139540 - Function HYPERLINK used in formula creates hyperlink independent from conditional evaluation
Summary: Function HYPERLINK used in formula creates hyperlink independent from conditi...
Status: CLOSED NOTABUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
6.4.7.2 release
Hardware: x86-64 (AMD64) All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Calc-Function
  Show dependency treegraph
 
Reported: 2021-01-11 14:33 UTC by [REDACTED]
Modified: 2021-04-13 09:42 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Steps to Reproduce Sample File (16.39 KB, application/vnd.oasis.opendocument.spreadsheet)
2021-01-11 14:38 UTC, [REDACTED]
Details

Note You need to log in before you can comment on or make changes to this bug.
Description [REDACTED] 2021-01-11 14:33:04 UTC
Description:
Use Case:
Create a hyperlink using function HYPERLINK() based on the content of other cells. If a reference cell contains a special value (or satisfies any other condition like "textual content starts with 'http'") create an hyperlink, otherwise show the content of another cell (or the content of the reference cell itself).

Problem Description (see also attachment)
The use case is implement through formula =IF(C2=TRUE();HYPERLINK(D2;E2);F2). While the IF statement correctly evaluates to FALSE in case of cell C2 is set to FALSE  the formula creates a (pointless) hyperlink to value in cell F2. 


Steps to Reproduce:
1. Open a LibreOffice Calc file
2. Define a refence cell C2 allowing TRUE,FALSE 
3. Enter a valid URL address into cell D2 (e.g. "https://libreoffice.org")
4. Enter some Text describing the URL into E2 (e.g. "LibreOffice Website")
5. Enter some Text alternate Text into F2 (e.g. "False Evaluation of IF")
6. Add to A2 formula =IF(C2=TRUE();HYPERLINK(D2;E2);F2)
7. Set C2 to FALSE
8. Hover mouse over text in cell A2 


Actual Results:
When hovering mouse pointer over text in cell A2, which correctly shows the text of FALSE evaluation, there is a (pointless) clickable hyperlink to that text (which of course results in an error if being clicked using CTRL+Click).


Expected Results:
Cell A2 is expected to show the pure text from cell F2 without being clickable (i.e. without being hyperlinked).



Reproducible: Always


User Profile Reset: Yes


OpenGL enabled: Yes

Additional Info:
Tested on:

Version: 6.4.7.2, Build-ID: 639b8ac485750d5696d7590a72ef1b496725cfb5
CPU-Threads: 8; BS: Linux 5.3; UI-Render: GL; VCL: kf5; 
Gebietsschema: de-DE (de_DE.UTF-8); UI-Sprache: de-DE,Calc: threaded

Version: 7.0.4.2 (x86), Build ID: dcf040e67528d9187c66b2379df5ea4407429775
CPU threads: 1; OS: Windows 10.0 Build 19042; UI render: default; VCL: win
Locale: de-DE (en_DE); UI: en-US, Calc: threaded

Additional Information

The problem also appears if using IFS() function. From a users perspective the issue looks like the hyperlink is being created during parsing phase (or whatever it might be called) of the formula and not awaiting the evaluation of conditional expression.
Comment 1 [REDACTED] 2021-01-11 14:38:31 UTC
Created attachment 168821 [details]
Steps to Reproduce Sample File

To test the "Steps to Reproduce" just use drop down in cell C2 to select TRUE() and/or FALSE() and hover with your pointer pointer over text in cell A2 to the hyperlink being created in any way.
Comment 2 [REDACTED] 2021-02-03 13:51:07 UTC
Bug still in:

Version: 7.1.0.3 / LibreOffice Community
Build ID: f6099ecf3d29644b5008cc8f48f42f4a40986e4c
CPU threads: 8; OS: Linux 5.3; UI render: default; VCL: kf5
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded
Comment 3 [REDACTED] 2021-03-09 22:51:59 UTC
Still present in 

Version: 7.1.1.2 / LibreOffice Community
Build ID: fe0b08f4af1bacafe4c7ecc87ce55bb426164676
CPU threads: 8; OS: Linux 5.3; UI render: default; VCL: kf5
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded
Comment 4 Eike Rathke 2021-04-12 12:22:33 UTC
Not a bug. HYPERLINK() works this weird way since Excel introduced it and produces a hyperlink on any formula where it is contained in. See also
https://www.openoffice.org/specs/calc/compatibility/HyperLinkFunction.sxw
specifically 6 Detailed Specification case I for this example.
Comment 5 [REDACTED] 2021-04-13 09:42:21 UTC
(In reply to Eike Rathke from comment #4)
> Not a bug. HYPERLINK() works this weird way since ...

Funny conclusion.