Bug 80043 - EDITING: Insert hyperlink dialog wont use text in highlighted cell as hyperlink text
Summary: EDITING: Insert hyperlink dialog wont use text in highlighted cell as hyperli...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: Other All
: medium enhancement
Assignee: Andreas Heinisch
URL:
Whiteboard: target:7.4.0
Keywords:
: 55342 129493 (view as bug list)
Depends on:
Blocks: Calc-UX Hyperlink-Dialog Hyperlink-Calc
  Show dependency treegraph
 
Reported: 2014-06-15 02:13 UTC by Yousuf Philips (jay) (retired)
Modified: 2023-06-21 21:26 UTC (History)
11 users (show)

See Also:
Crash report or crash signature:


Attachments
shows that cell A1 is selected but hyperlink dialog doesnt put 12 as the text in the 'Text' field (105.28 KB, image/png)
2014-06-15 02:13 UTC, Yousuf Philips (jay) (retired)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Yousuf Philips (jay) (retired) 2014-06-15 02:13:12 UTC
Created attachment 101076 [details]
shows that cell A1 is selected but hyperlink dialog doesnt put 12 as the text in the 'Text' field

If you open calc and in A1 type '12' and press enter. then select A1 and press the add hyperlink button in the toolbar, it wont use '12' as the hyperlink text. It works if i select '12' within the cell, but not when i select the cell itself.
Comment 1 Cor Nouws 2014-06-15 09:52:02 UTC
thanks Jay :)
Comment 2 Yousuf Philips (jay) (retired) 2014-06-15 22:08:35 UTC
Just happened to notice this when i was testing bug 79972 in ms word and noticed it did it but LibO doesnt. :)
Comment 3 Yousuf Philips (jay) (retired) 2017-10-22 00:45:25 UTC
Still present.

steps:
1. open calc
2. type 12 into A1 and press enter
3. press up key to return to A1
4. insert hyperlink
5. 'text' field doesnt show '12'

Version: 6.0.0.0.alpha1+
Build ID: 8ba60ca42d4d1873b8cd85c5d3b5ed2f0e19df60
CPU threads: 2; OS: Linux 4.4; UI render: default; VCL: gtk2; 
Locale: en-US (en_US.UTF-8); Calc: group
Comment 4 Cor Nouws 2017-11-05 22:20:05 UTC
Thinking about reconsidering my support for this.
A 'highlighted' cell as meant here, is a cell with the cell-focus.
Always the behavior is: start typing/pasting, and the current content is ignored and replaced.
As such, the current behavior is logic and consistent.
Comment 5 Heiko Tietze 2017-11-06 17:42:15 UTC
We should take care about over-engineering. What should be shown in case of "foo http://test.com bar"? So how about keeping the current behavior and fill in the dialog only when the cell contains a valid link.
Comment 6 Yousuf Philips (jay) (retired) 2017-11-06 22:19:33 UTC
(In reply to Heiko Tietze from comment #5)
> We should take care about over-engineering. What should be shown in case of
> "foo http://test.com bar"?

The same as we show in Writer, "foo http://test.com bar".

> So how about keeping the current behavior and
> fill in the dialog only when the cell contains a valid link.

I dont think the current behaviour is good and tested Excel, WPS, Softmaker and Google Docs and all take the cell contents as the text.

@Eike, Stuart: What do you think?
Comment 7 Thomas Lendo 2017-11-13 12:17:26 UTC
I think the current behavior is not good. Users expect that the software is doing as much as possible automatically. If I select a cell (or several cells) and add a hyperlink, then I would expect that the text in this cell (these cells) is transformed to a hyperlink.

MSO Excel 2013 works like that. The result of point 5 in comment 3 from Jay is that the "Text" textfield is grayed out. All but the text itself can be edited.

This is a good solution because
- the user can't edit the cell content(s) with a grayed out text field but a hyperlink can be added (which prevents confusion or that content and formatting can be destroyed),
- the user can add a hyperlink to a whole cell or several cells as he can do it with a text string (same behavior).
Comment 8 Heiko Tietze 2017-11-13 14:54:07 UTC
(In reply to Yousuf Philips (jay) from comment #6)
> The same as we show in Writer, ...
> I dont think the current behaviour is good and tested Excel...

Calc contains structured data which makes it different to Writer.

Excel 2010:

123 http://test.com 456 -> no hyperlink
123 http://test.com     -> no hyperlink
    http://test.com 456 -> no hyperlink
    http://test.com     -> hyperlink

Regina, any relevant aspects from ODF spec?
Comment 9 Eike Rathke 2017-11-13 16:07:35 UTC
Excel can have only one hyperlink per cell and only a hyperlink if a hyperlink, no further text. That's not a good example. And not even related to the original request. ODF doesn't have that limitation.

If I understood correctly, the original request is to prefill the hyperlink's Text field with the cell content the cell cursor is on (as if the entire cell content was selected when doing in-cell editing), and when applied the hyperlink should replace the cell content. Correct?
Comment 10 Yousuf Philips (jay) (retired) 2017-11-13 16:14:52 UTC
(In reply to Eike Rathke from comment #9)
> If I understood correctly, the original request is to prefill the
> hyperlink's Text field with the cell content the cell cursor is on (as if
> the entire cell content was selected when doing in-cell editing), and when
> applied the hyperlink should replace the cell content. Correct?

Yes this is what was requested. But there will be situations when the cell contents have a hyperlink in it, and ideally in this case, it would clear any hyperlinks already present and creating the new hyperlink that covers all the cells text.
Comment 11 Thomas Lendo 2017-11-13 19:02:35 UTC
@Eike: I meant the same as you do. I'm referring to Jay's steps in comment 3.

I think Heiko means another case for auto-hyperlinking cell-content without the hyperlink dialog which isn't was Jay had in mind when creating this bug.
Comment 12 Cor Nouws 2017-12-29 15:35:05 UTC
(In reply to Yousuf Philips (jay) from comment #10)

As written in comment #5: its against the nature of editing in Calc
Comment 13 Cor Nouws 2018-10-12 11:43:28 UTC
propose to add to the agenda of the UX meeting(s).
Comment 14 Thomas Lendo 2018-10-16 23:10:42 UTC
I support comment 9 and comment 10 as this is what I expect when clicking on the hyperlink command at a cell with content.

(In reply to Cor Nouws from comment #12)
> As written in comment #5: its against the nature of editing in Calc
Why is this against of Calf's nature? Software should ease user's work. It's only a question what users expect. What is the benefit of the current behavior?
Comment 15 Cor Nouws 2018-10-17 18:48:17 UTC
(In reply to Cor Nouws from comment #4)
> Thinking about reconsidering my support for this.
> A 'highlighted' cell as meant here, is a cell with the cell-focus.
> Always the behavior is: start typing/pasting, and the current content is
> ignored and replaced.
> As such, the current behavior is logic and consistent.

The requested behavior makes that the content (foo) is indeed replaced, by the hyperlink. So my comment was confused - I support this request.
Comment 16 Heiko Tietze 2018-10-18 07:26:47 UTC
We discussed the request in the design meeting and support the idea. Removing needsUX.
Comment 17 Heiko Tietze 2019-12-19 12:32:01 UTC
*** Bug 129493 has been marked as a duplicate of this bug. ***
Comment 18 Andreas Heinisch 2022-03-07 21:41:37 UTC
Could this be viable solution: https://gerrit.libreoffice.org/c/core/+/131156
Comment 19 Andreas Heinisch 2022-03-26 21:19:36 UTC
May anyone can clarify my doubts here. The proposed patch just inserts the entire text into the hyperlink text as requested.

After I made my settings in the hyperlink dialog, should the entire content of the selected cell be replaced or should the hyperlink inserted after the cursor in the respective cell?
Comment 20 Heiko Tietze 2022-03-28 07:40:48 UTC
(In reply to Andreas Heinisch from comment #19)
> May anyone can clarify my doubts here. The proposed patch just inserts the
> entire text into the hyperlink text as requested.
> 
> After I made my settings in the hyperlink dialog, should the entire content
> of the selected cell be replaced or should the hyperlink inserted after the
> cursor in the respective cell?

See comment 10: use the whole cell content if nothing has been selected, otherwise use the selection; as a bonus, if the cell/selection contains a hyperlink use only this part of the text
Comment 21 Commit Notification 2022-04-07 09:32:38 UTC
Andreas Heinisch committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/803c9a6f8d8681e1862e4132dbbc8cdb2f61b7b6

tdf#80043 - Put selected text into hyperlink item

It will be available in 7.4.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 22 Buovjaga 2022-05-03 16:15:03 UTC
*** Bug 55342 has been marked as a duplicate of this bug. ***