Bug 75820

Summary: EDITING: IF function with HYPERLINK as Then_value causes HYPERLINK also on Otherwise_value
Product: LibreOffice Reporter: panoworks
Component: SpreadsheetAssignee: Not Assigned <libreoffice-bugs>
Status: UNCONFIRMED --- QA Contact:
Severity: normal    
Priority: medium CC: mariosv
Version: 4.2.1.1 release   
Hardware: x86-64 (AMD64)   
OS: Windows (All)   
Whiteboard:
i915 platform: i915 features:

Description panoworks 2014-03-06 05:55:06 UTC
Example:
=IF(FALSE,HYPERLINK("http://freedesktop.org/","freedesktop.org"),"this should not be a link")

Causes a hyperlink to be inserted with both URL and text "this should not be a link".

The context in which I use this is where there's a text and a URL field, and only if the URL field is filled in, the cell with the formula will have a hyperlink - otherwise just the text.
Comment 1 m.a.riosv 2014-03-06 23:25:41 UTC
Hi panoworks, thanks for reporting.

I think it's not possible use HYPERLINK() in that way.
Help have:
"
HYPERLINK
When you click a cell that contains the HYPERLINK function, the hyperlink opens.
"

On other hand, if FALSE is not defined as range name, the function is FALSE().

If you want a workaround, a second hyperlink with a referencing the proper cell where the hyperlink is, does nothing:
 
=IF(FALSE();HYPERLINK("http://freedesktop.org/";"freedesktop.org");HYPERLINK("#"&CELL("address");"this should not be a link"))
Comment 2 panoworks 2014-03-07 09:05:45 UTC
FALSE vs FALSE() doesn't really seem to make a difference (again: in my use case I check if the URL cell is empty or not, and intend to only insert a hyperlink if the URL cell is not empty)

Your suggested work-around is interesting, though I guess it really just sets up a hyperlink to itself, rather than no hyperlink :)

The question is, if the definition is as follows,
"When you click a cell that contains the HYPERLINK function"
then does =IF(FALSE(),HYPERLINK("http://freedesktop.org/";"freedesktop.org"),"not a link") mean that the cell contains the hyperlink function?

On the one hand, the function is certainly used in the formula, so yes.
On the other, the formula suggests that the function is not what actually gets used for the cell's content, so no.
Comment 3 QA Administrators 2014-10-05 23:05:41 UTC
Dear Bug Submitter,

This bug has been in NEEDINFO status with no change for at least 6 months. Please provide the requested information as soon as possible and mark the bug as UNCONFIRMED. Due to regular bug tracker maintenance, if the bug is still in NEEDINFO status with no change in 30 days the QA team will close the bug as INVALID due to lack of needed information.

For more information about our NEEDINFO policy please read the wiki located here: 
https://wiki.documentfoundation.org/QA/FDO/NEEDINFO

If you have already provided the requested information, please mark the bug as UNCONFIRMED so that the QA team knows that the bug is ready to be confirmed.


Thank you for helping us make LibreOffice even better for everyone!


Warm Regards,
QA Team
Comment 4 panoworks 2014-10-06 20:50:29 UTC
switching to UNCONFIRMED (although I guess m.a.riosv sort-of confirmed it).  All the required information is in the post.  The question is whether in the case of an IF+HYPERLINK combination, the rules for an IF get precedence, or whether the rules for a HYPERLINK get precedence.  I'm obviously of the view that the former should apply.  Either which way, it would be good to clarify somewhere (documentation, 'known issues', whatever) - even though I realize that this is probably not a very oft-used construction :)

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.