Bug 161134 - Pasting URLs and email addresses with "Values Only" preset from the Paste Special dialog will format values as hyperlinks
Summary: Pasting URLs and email addresses with "Values Only" preset from the Paste Spe...
Status: RESOLVED NOTABUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
24.2.3.2 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: needsUXEval
Depends on:
Blocks: Hyperlink Paste-Special
  Show dependency treegraph
 
Reported: 2024-05-16 13:26 UTC by J22Gim
Modified: 2024-06-07 07:28 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description J22Gim 2024-05-16 13:26:47 UTC
Description:
If you copy "mail@mail.com" or "https://bugs.documentfoundation.org/" and then try to paste without hyperlinks or any other formatting, it doesn't work: The pasted element is an email/URL just like the one you copied into the clipboard.

Steps to Reproduce:
1. populate a cell with either "mail@mail.com" or "https://bugs.documentfoundation.org/" and press enter (to make sure it gets converted into a hyperlink)
2. now copy the cell into the clipboard
3. try to past it elsewhere without format (I do CTRL + Shift + V to brig the special paste dialog, then press the Values Only button)

Actual Results:
The cell is pasted with the hyperlink and associated formatting

Expected Results:
The target cell should contain plain text like "mail@mail.com" or "https://bugs.documentfoundation.org/" without hyperlinks or any other thing besides text.


Reproducible: Always


User Profile Reset: No

Additional Info:
Version: 24.2.3.2 (X86_64) / LibreOffice Community
Build ID: 420(Build:2)
CPU threads: 24; OS: Linux 6.5; UI render: default; VCL: qt5 (cairo+xcb)
Locale: en-US (en_US.UTF-8); UI: en-US
Ubuntu package version: 4:24.2.3~rc2-0ubuntu0.22.04.1~lo1
Calc: CL threaded
Comment 1 J22Gim 2024-05-16 13:29:04 UTC
Just noticed, after posting, that text box of this bug report automatically assigns hyperlinks, thus even if I don't see it at the time of writing, this@will.be shown as a hyperlink after I press "save changes".
Just a heads up because it may seem confusing in my OP
Comment 2 Rafael Lima 2024-05-16 17:23:30 UTC
I can reproduce this.

It is not simply a matter of copy/paste, but rather how Calc deals with URL's and email addresses.

Even if you simply type mail@mail.com into any cell, it will autoformat as a hyperlink, hence the hyperlink when you paste an email address as value into a cell.

Not sure what to do here though. But I agree that pasting only values should not format as a hyperlink.
Comment 3 ady 2024-05-16 19:55:35 UTC
(In reply to Rafael Lima from comment #2)
> I can reproduce this.
> 
> It is not simply a matter of copy/paste, but rather how Calc deals with
> URL's and email addresses.
> 
> Even if you simply type mail@mail.com into any cell, it will autoformat as a
> hyperlink, hence the hyperlink when you paste an email address as value into
> a cell.
> 
> Not sure what to do here though. But I agree that pasting only values should
> not format as a hyperlink.

Unfortunately, this is a contradiction between those two situations. Pasting a text value as value only, when Calc performs that action correctly, would be equivalent to typing-in the same exact text (i.e. with no additional formatting).

The only way to block the "URL autoformat" would be to disable such "autoformat". Unfortunately, some users actually ask for this kinds of automatic formatting, and even have requested for it to be more prominent (e.g. blue underline with some kind of colored background, etc.).

This is not the first time this "URL autoformat" generates problems for (partial) copy-paste, whether it is with paste special or common paste.
Comment 4 Stéphane Guillou (stragu) 2024-06-06 13:26:49 UTC
(In reply to ady from comment #3)
> Unfortunately, this is a contradiction between those two situations. Pasting
> a text value as value only, when Calc performs that action correctly, would
> be equivalent to typing-in the same exact text (i.e. with no additional
> formatting).
> 
> The only way to block the "URL autoformat" would be to disable such
> "autoformat".
I agree with ady. I think pasting unformatted text does not mean it won't follow autocorrect rules as defined in Tools > AutoCorrect options > Options.
In my opinion, the main issue is that you can't Ctrl + Z that change, as requested in bug 79404.

UX/Design, what is your take?
Comment 5 V Stuart Foote 2024-06-06 15:28:49 UTC
You are bumping into the Auto-correction option 'URL Recognition'

Disable it by check box from Tools -> 'AutoCorrect Options...' dialog's Options tab.

Also, as you note you still may want to paste special as plain text to avoid any formatting the source cell/URL may contain for it to take on cell formatting.
Comment 6 Heiko Tietze 2024-06-07 07:28:21 UTC
You may also enter in the formula bar ="https://bugs.documentfoundation.org/"