Bug 103447 - Cell containing hyperlink (URL or email), is not synchronized properly between cell and input line (mismatch in display, edit and selection)
Summary: Cell containing hyperlink (URL or email), is not synchronized properly betwee...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
3.5.0 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
: 114022 145073 146020 154413 (view as bug list)
Depends on:
Blocks: Calc-Formula-Bar Hyperlink-Calc
  Show dependency treegraph
 
Reported: 2016-10-24 05:03 UTC by Aron Budea
Modified: 2023-12-01 18:34 UTC (History)
9 users (show)

See Also:
Crash report or crash signature:


Attachments
Sample spreadsheet with a URL, see comment 6 on how to use it to reproduce some of the issues (7.94 KB, application/vnd.oasis.opendocument.spreadsheet)
2016-10-25 05:45 UTC, Aron Budea
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Aron Budea 2016-10-24 05:03:19 UTC
This is a follow up on bug 100038, https://bugs.documentfoundation.org/show_bug.cgi?id=100038#c2 in particular.
Sample cell entry from original bug report: "40V, 200mA, h=100@1V,10mA".

A couple of closely related issues with URL recognition in Calc:

1. If the text is typed(!) in a cell with a space after the comma after the "link" (so, as "40V, 200mA, h=100@1V, 10mA"), weirdly, right-clicking the text in the Input line above the sheet permanently removes the URL (sometimes this can be reproduced if there's no space there, but it's not that consistent).

2. Sometimes the link is displayed as a link in the Input line (if it's typed in there, for example), but if you move between cells and come back, it will show as normal text (still in Input line).
Particularly if you move with cursors, it'll stay as a link, if you select the cell with mouse, it'll be normal text.

3. When it's not displayed as a link in the Input line, and part of the text/link is selected, the selection shown in the cell won't be the same.

4. Using autocomplete to finish the entry based on a previous one does not create links.

Originally tested with 5.1.3.2, still reproduced with 5.3.0.0.alpha1 / Windows 7.
Comment 1 Aron Budea 2016-10-24 05:04:43 UTC
Setting to new based on original bug report.
Comment 2 Frederick Eaton 2016-10-24 05:22:55 UTC
Thank you, Aron.
Comment 3 V Stuart Foote 2016-10-24 13:24:43 UTC
So seems the issue is with the logic of the autocorrect recognition of "what" sequence represents a URL -- presumably sequences with punctuation in proximity to the U+0040 (COMMERCIAL AT) glyph. I have not looked for where those rules are, but would expect they are global right now, and would do similar things in all modules.

Yep, just verified 1 & 2 affect input in Writer, so a global autocorrect recognition of URL.  Probably should not recognize the U+002c (COMMA) followed by the space as a trigger for URL recognition.  

And for 3 & 4, simply moving cursor focus away does not trigger the auto-correct to change/corrupt the content. So actually find that behavior consistent and somewhat expected.

None the less, ability to toggle a separate set of autocorrect rules/behavior for Calc as in bug 98154 would be useful.
Comment 4 Aron Budea 2016-10-25 02:55:16 UTC
Let me adjust the title. Here the issue is not with the autocorrect (URL recognition) itself, but with the handling of URLs that are already there.

Like, in relation to issue 1. we can debate whether URL recognition should stop at the comma or not, but the behavior described there should not occur (eg. removing the URL-ification by clicking inside the Input line), and should not depend on whether there's a space after the comma or not.
Comment 5 Joel Madero 2016-10-25 03:01:42 UTC
Please at least attach a simple test document to this bug report so we don't have to go digging into a second bug report to find what we need. Thanks
Comment 6 Aron Budea 2016-10-25 05:45:52 UTC
Created attachment 128231 [details]
Sample spreadsheet with a URL, see comment 6 on how to use it to reproduce some of the issues

All the details that are needed are in this bug report, though it might not be clear without knowing that the original bug report was about URL recognition.
The mentioned sample text ("40V, 200mA, h=100@1V,10mA") contains a "@", which causes "100@1V" to be recognized as a URL when it's entered. This report is not about the URL recognition itself, but about some issues when it comes to working with cells containing URLs.

For the 1st issue you have to type the text in, or copy/paste and trigger autocorrect with a space in the appropriate position.
For issues 2-4 you can use the text with the recognized URL, but to make it easier, I'm attaching it in a file as well.

Based on the attachment:

2. Switch to A2, then back to A1 using the keyboard. Note how the Input line shows the URL as a URL (like the cell).
Now do the same using the mouse (select A2, then A1). Note how the Input line shows the URL as plain text.

3. When it shows the URL as plain text in the Input line, select part of the URL there, for example "00@1V". The cell shows the selection incorrectly ("0mA" for me in this case).

4. Interestingly, right now I can't reproduce this (eg. using autocomplete to enter the same entry in another cell does produce the link inside). I doubt it's fixed, but I don't want to spend too much time on this.
Comment 7 QA Administrators 2017-10-26 08:09:26 UTC Comment hidden (obsolete)
Comment 8 QA Administrators 2020-10-27 04:24:33 UTC Comment hidden (obsolete)
Comment 9 Aron Budea 2020-12-07 04:56:23 UTC
The 1st is fine now, but bugs 2-4 are still reproducible in LO 7.2.0.0.alpha0+ (7673b027daed248d1be4dd1a773bfc0334a00c53) / Ubuntu.
Comment 10 QA Administrators 2022-12-08 03:25:33 UTC Comment hidden (obsolete)
Comment 11 Stéphane Guillou (stragu) 2023-10-19 19:59:11 UTC
I still reproduce in a recent trunk build:

Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: b83f069101f1e6d8aaac09a805f02bbc4c619e7a
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded

Has been observed in 3.5 as well, as shown in bug 114022.

See the description of the "cycling" nature of the issue, described by Mike in duplicate bug 146020:

(Mike Kaganski from bug 146020 comment #0)
> Created attachment 176665 [details]
> Screen cast
> 
> When a Calc cell contains a URL field, entering the formula bar first time
> does not highlight the field, *and navigates the URL content as if it is
> normal text*. Clicking to the same cell to leave formula bar, then entering
> the formula bar again, (but *not* leaving this cell!) highlights the field,
> and starts to "jump" over the field, and usual. Leaving the cell, and
> entering it again, starts the sequence anew.
Comment 12 Stéphane Guillou (stragu) 2023-10-19 20:01:42 UTC
*** Bug 114022 has been marked as a duplicate of this bug. ***
Comment 13 Stéphane Guillou (stragu) 2023-10-19 20:04:27 UTC
*** Bug 146020 has been marked as a duplicate of this bug. ***
Comment 14 Stéphane Guillou (stragu) 2023-10-19 20:27:38 UTC
*** Bug 145073 has been marked as a duplicate of this bug. ***
Comment 15 Stéphane Guillou (stragu) 2023-10-21 05:50:16 UTC
*** Bug 154413 has been marked as a duplicate of this bug. ***
Comment 16 ady 2023-12-01 18:34:29 UTC
FWIW (url/hyperlink/email address)...

From:

 https://ask.libreoffice.org/t/cant-edit-a-url-in-a-calc-cell/98712/9

With minor rewording:

1. Focus on the cell containing the URL you want to edit.
2. Click the "=" icon in the formula bar.
3. Edit the URL text in the formula bar.

Step 2 is key.