After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 81718 - HYPERLINK function does not make cell a link.
HYPERLINK function does not make cell a link.
Status: RESOLVED OBSOLETE
Product: Gnumeric
Classification: Applications
Component: Main System
git master
Other All
: Normal enhancement
: ---
Assigned To: Jody Goldberg
Jody Goldberg
: 128534 131110 341874 352588 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2002-05-14 06:47 UTC by Maurits Rijk
Modified: 2018-05-22 13:03 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Initial patch (11.33 KB, patch)
2013-10-18 09:45 UTC, Jean Bréfort
rejected Details | Review
Preliminary VALUE_FMT based patch (5.25 KB, patch)
2013-10-19 18:35 UTC, Morten Welinder
rejected Details | Review
Preliminary patch (10.06 KB, patch)
2013-10-22 00:40 UTC, Morten Welinder
needs-work Details | Review
Updated patch (8.71 KB, patch)
2013-10-26 19:29 UTC, Morten Welinder
none Details | Review

Description Maurits Rijk 2002-05-14 06:47:05 UTC
Excel 2000 (don't know about other versions) has an option to insert
hyperlinks into a sheet. I especially like the option to insert a link to
"Place in This Document" that allows quick navigation through complicated
sheets.
Comment 1 Jody Goldberg 2002-07-20 05:04:57 UTC
I have begun support for this.  We can now import this from XL
and have it work in gnumeric, including cursor changes and tooltips.
We also support urls.

Still to do
    - xml persistence
    - Creation dialog
    - Decision on editing/removal semantics
Comment 2 Morten Welinder 2002-07-22 15:44:39 UTC
jody: also function HYPERLINK, I guess.
Comment 3 Jody Goldberg 2002-08-01 22:40:25 UTC
Hmm, the function will require another mechanism.
Probably a new value type.
Comment 4 Andreas J. Guelzow 2003-07-06 07:24:28 UTC
hmm,

xml persistence, creation and deletion (via clear all) seems to work.

What is left here?
Comment 5 Jody Goldberg 2003-07-06 17:21:06 UTC
3) hlinks 
    3.1) Finish the edit dialog to load and store results       (DONE)
    3.2) Figure out import semantics of the other 2 XL types
    3.3) email support ? via system 'evoltion mailto:....'
    6.10) hlink export


I see xml-sax export, but not import.
Comment 6 Maurits Rijk 2004-04-23 06:58:38 UTC
Just out of curiosity (I'm perfectly happy already with the hyperlink support
that comes with 1.2): is this going to be fully implemented in 1.4?
Comment 7 Jody Goldberg 2004-04-23 14:09:20 UTC
I'd like to get xls export in place for 1.4
Comment 8 Jody Goldberg 2004-09-27 02:15:20 UTC
sigh, doesn't look like it's going to be done before the release.
Comment 9 Jody Goldberg 2004-09-27 02:15:28 UTC
sigh, doesn't look like it's going to be done before the release.
Comment 10 Jody Goldberg 2005-01-14 01:37:31 UTC
It would indeed be nice, 
Comment 11 Morten Welinder 2006-04-14 01:58:47 UTC
*** Bug 131110 has been marked as a duplicate of this bug. ***
Comment 12 Andreas J. Guelzow 2006-05-16 06:13:03 UTC
*** Bug 341874 has been marked as a duplicate of this bug. ***
Comment 13 Andreas J. Guelzow 2006-08-23 19:59:52 UTC
*** Bug 352588 has been marked as a duplicate of this bug. ***
Comment 14 Jaakko R 2006-12-31 14:01:15 UTC
On 1.6.3, hyperlink function does not make the cell clickable.  Insert->Hyperlink works as expected.

Not sure if this should be reported as a separate bug.
Comment 15 Jody Goldberg 2007-11-16 03:47:53 UTC
*** Bug 497191 has been marked as a duplicate of this bug. ***
Comment 16 Jody Goldberg 2007-11-18 16:29:09 UTC
Ok, xls export is done, and xls import is patched to support some of the new types.   The file based links are not terribly useful without some mechanism for mapping the paths into something useable.  We can open a new bug for that.
Comment 17 Andreas J. Guelzow 2009-12-30 22:45:39 UTC
*** Bug 128534 has been marked as a duplicate of this bug. ***
Comment 18 Corrie 2011-03-13 04:19:21 UTC
This is quite an old bug now, and every other spreadsheet with HYPERLINK() support has clickable cells.

What's the status of this issue?
Comment 19 Andreas J. Guelzow 2011-03-14 16:45:15 UTC
You can create clickable cells in Gnumeric too by adding a hyperlink. I have yet to see any use case for HYPERLINK that would not be better solved by adding a huperlink.

Note that even the OpenFormula draft of ODF does not require the cell to become a hyperlink in the presence of the HYPERLINK function. The behaviour of HYPERLINK between those implementations that create links varies to greatly.
Comment 20 Corrie 2011-03-14 22:16:35 UTC
You cannot change a cell that has a hyperlink formula into a clickable hyperlink cell in Gnumeric. And adding a hyperlink doesn't take a forumula, it takes a URL in the dialog.

I have seen many use cases for it, and I have one, which prompted this question.

And from OpenDocument-v1.2-cd05-part2-editor-revision.odt : "If a formula contains a HYPERLINK function, the cell becomes a "hyperlink cell". Clicking on this cell will execute the contained hyperlink. "

See: http://www.oasis-open.org/committees/documents.php?wg_abbrev=office-formula



So I'm not sure what the relevance of any of your responses are.
Comment 21 Andreas J. Guelzow 2011-03-14 22:32:37 UTC
You were asking "What's the status of this issue." As long as there is no reasonable use case it is doubtful that any of the current developers is going to spend time working on it. Your comment "I have seen many use cases for it" doesn't change that unless you can elaborate on it.

From OpenDocument-v1.2-csd06-rev02-part2.odt:
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.

The document you were looking at is outdated. Gnumeric provides a complete implementation of HYPERLINK according to this latest draft (which is likely to become the OASIS ODF 1.2 standard.)

The relevance of my responses? Possibly none, but I think a response to your initial question of "The status of this issue is 'NEW'" would have helped even less.

Unless there is some real strong use case made for this it doesn't look like the behaviour of the HYPERLINK function will be augmented any time soon. (Of course I only represent 25 to 34% of the currently active developers.)
Comment 22 Corrie 2011-03-14 23:22:46 UTC
I see. Well, I stand corrected. I thought I had the latest version of the spec.

I do have a use case, but you say you don't have a "strong" use case and so you think it doesn't need to be done. This doesn't make me think supplying a use case will actually help, it makes me think it'll just be met with resistance.

The fact is that OpenOffice chooses to make the cell of a HYPERLINK result clickable, and that is for me the standard behaviour, otherwise interoperability is lost.

But thank you for your responses.
Comment 23 Andreas J. Guelzow 2011-03-14 23:35:12 UTC
Corrie, I am seriously interested in hearing about the use case you have. 

In the past the uses I have seen were all equivalent to simply formatting the cell as a hyperlink. In fact when we discussed the HYPERLINK function in the OASIS OpenFormula SC of the ODF TC nobody presented a good use case (and the behaviour in OOo is already very different from that in Excel).

Implementing this augmentation of HYPERLINK in Gnumeric wil require some significant changes to the Gnumeric code (since this crosses format to calculation boundaries) and so it would be important to see how it is supposed to be used to try to get this right.

If we were simply opposed to implementing such an augmentation we would have closed this report as a WONTFIX.
Comment 24 Andreas J. Guelzow 2011-03-14 23:41:14 UTC
To elaborate a little more, I have never understood why in OOo (and Excel)
=IF (1=1,2,HYPERLINK("http://www.math.concordia.ab.ca",3))
causes the cell to be a hyperlink and what it would be good for.
Comment 25 Corrie 2011-03-14 23:56:05 UTC
Yes, I see why you think that, but you forget that the url string itself can be a calculated value:)
Comment 26 Corrie 2011-03-14 23:58:27 UTC
Please accept my apologies if I've misjudged you.

Well, without suggesting that my use case is widely applicable, here is the
user story:

I have several columns of data items in a spreadsheet, and they change from
time to time. Changes to the column cells are entered by hand, but can
conceivably also be from a formula.

I then have another column to make lookups, with cells containing something
like =HYPERLINK(CONCATENATE("http://www.google.com/search?&q=", A2, "+", A3))
for a search on google.com of the web.

Another column in the same row might have
=HYPERLINK(CONCATENATE("http://www.google.co.nz/search?q=", A2, "+", A3,
"&cr=countryNZ")) for a search of the web, NZ local sites, from google.co.nz

I have other cases which use the same principle, but with more specialized
search sites, always with a calculated URL.

In OpenOffice Calc, this does the job for me, but in Gnumeric I don't have the
same option because the cells with the HYPERLINK formula is not clickable.

And there is no way to mark the cell clickable either (that I am aware of).
Comment 27 Andreas J. Guelzow 2011-03-15 00:44:00 UTC
So, do I understand correctly that in your use cases, the HYPERLINK function will always be the outermost function in the formula for the cell?
Comment 28 Corrie 2011-03-15 00:47:51 UTC
Correct, but only because I use HYPERLINK as the outer function to get the cell to be clickable.
Comment 29 Jean Bréfort 2013-10-18 09:45:29 UTC
Created attachment 257627 [details] [review]
Initial patch

I'm not sure how the new value type should behave in all cases, I tried to make it look like strings.
One strange thing is that a formula like =if(A1=0,"",hyperlink(A1,"link") works when loaded from a gnumeric or ods file but needs a manual recalculation before the link becomes active when loaded from an xls file, the string might even not be correctly displayed (getting 0 instead).
Comment 30 Morten Welinder 2013-10-19 00:57:35 UTC
Unless we have rock-solid evidence that XL treats hyperlinks as a separate
value type we should not go there.  Value types lead to nightmare in
evaluation land.

Can we get away with just doing approximately what we do for expressions
like =PV(...), i.e., auto-format?  In this case, recognize that a new
expression has been entered and that its outer function is HYPERLINK?

Another option is to have hyperlinks be strings with some rich-text
formatting.
Comment 31 Jean Bréfort 2013-10-19 08:25:45 UTC
ok, I tried the new value type solution because of comment #3. The auto-format solution looks beyond my expertise.
Comment 32 Morten Welinder 2013-10-19 18:34:20 UTC
I have a variant of your patch that uses a custom pango attribute.
It doesn't quite work yet because go_format_new_markup (and later
go_format_parse_markup) ignore custom attributes except subscript/superscript.

I'll attach it, but it may not apply because it depends trivially of stuff
I cannot push from here.
Comment 33 Morten Welinder 2013-10-19 18:35:30 UTC
Created attachment 257729 [details] [review]
Preliminary VALUE_FMT based patch
Comment 34 Morten Welinder 2013-10-21 19:28:15 UTC
Comment on attachment 257627 [details] [review]
Initial patch

rejecting -- see upcoming description
Comment 35 Morten Welinder 2013-10-21 19:28:48 UTC
Comment on attachment 257729 [details] [review]
Preliminary VALUE_FMT based patch

rejecting -- see upcoming description
Comment 36 Morten Welinder 2013-10-21 19:39:37 UTC
HYPERLINK is kind of magic.

A cell becomes a hyperlink if its expression uses the HYPERLINK function.
(Anywhere -- not necessarily in a part of the expression actually evaluated.)

During normal evaluation, HYPERLINK simply returns its second argument,
except that an error in the first argument dominates.  Any value type seems
to be valid.

There is a special evaluation mode for the link target in which HYPERLINK
returns its first argument.  The whole expression is evaluated again for
this purpose.

Excel has some weirdness as to what it takes for a link to be shown as a
link (blue colour and underlining).  It appears to me that it happens when
the first function call is to HYPERLINK.  I don't think we need to emulate
that.
Comment 37 Morten Welinder 2013-10-22 00:40:08 UTC
Created attachment 257804 [details] [review]
Preliminary patch

This starts implementing things.

Parts of this can go in now, actually:

* Moving flags into the structure for function_call_with_exprs
* Change sheet_hlink_find to transfer a ref
* Change ItemGrid to hold a ref to cur_link
Comment 38 Morten Welinder 2013-10-26 19:29:42 UTC
Created attachment 258186 [details] [review]
Updated patch

Updated patch that does the second evaluation.

This patch is uncomfortably intrusive in the core.  It messes with dependents
in order to clear the old tooltips when evaluation is going on.
Comment 39 Danilo Câmara 2015-02-25 16:44:51 UTC
If someone are still wondering about use cases: A have a web application and most data are accessible by URL. I use spreadsheet as a draft tool for custom data manipulation and analysis. Clickable HYPERLINK formula is very handy for me to consult (or even change) data in the database. Anyway it's a variation of the google case in Comment 26.
Comment 40 GNOME Infrastructure Team 2018-05-22 13:03:25 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gnumeric/issues/15.