Bug 162621 - Rich text should be pasted as unformatted text after double-clicking in a cell
Summary: Rich text should be pasted as unformatted text after double-clicking in a cell
Status: RESOLVED NOTABUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
24.8.0.0 alpha0+
Hardware: x86-64 (AMD64) All
: medium minor
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-08-25 05:49 UTC by molnarszilard
Modified: 2024-08-26 09:40 UTC (History)
3 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 molnarszilard 2024-08-25 05:49:19 UTC
Description:
I already asked about this issue at https://ask.libreoffice.org/t/libreoffice-calc-paste-unformatted-text-by-double-clicking-in-a-cell/108486?u=molnarszilard, but did not get a definitive answer from a developer.

Previously, (up until version 24.2.0.3) if I copied a text (ex. from a browser) and clicked on a cell in LO Calc, Ctrl+V would paste the text preserving the formatting from the source (or ask me what to do with a pop-up window), however, if I double-clicked on the cell, it would go into Edit mode, and now Ctrl+V would paste the text unformatted.

In the newer 24.2.1.1 version, in both cases, the text will be pasted with the original formatting (using only one click opens the Import Options pop-up window as previously). If I want to paste the text unformatted, I have to right-click on the cell->Paste Special → Unformatted Text. (Although, sometimes not all of the formatting are kept, just a few, e.g. When I copy-pasting something from the 'Enter A Bug' wepage, unless it is a link, the pasted text is no longer colored or bolded, only the font is kept - Liberation Serif over the cell default Liberation Sans).

It was quite convenient to double-click on a cell, and then use Ctrl+V to paste the text unformatted.

Is this a bug or is there a setting that could get the previous behavior back?

(As a workaround I tried to switch the shortcuts Ctrl+V with Shift+Ctrl+Alt+V. In this way, single-click on the cell then `Ctrl`+'V' would paste the unformatted text, while double-click (or single-click+`F2`) and then `Ctrl`+'V' would paste the formatted text. I will see how much I can get used to this - actually, might be even better.
However, this is only a workaround (which usually does not mean that the original issue is resolved), and other user might also try to search this issue. I consider this issue as resolved if the original behavior is restated, or a developer says, that the new behavor is intended.) 

Steps to Reproduce:
1. Create a new Spreadsheet
2. Copy a formatted text from somewhere (e.g. a webpage)
3. Double-click into a cell (or single-click then F2)
4. Press Ctrl+V

Actual Results:
The copied text is pasted with the original formatting

Expected Results:
The copied text is pasted with the default formatting of the cell


Reproducible: Always


User Profile Reset: No

Additional Info:
I have this issue on Ubuntu 20.04 (installed on a computer), and on Debian 12 (live environment), and someone else reproduced this issue on Windows https://ask.libreoffice.org/t/libreoffice-calc-paste-unformatted-text-by-double-clicking-in-a-cell/108486/4?u=molnarszilard
Comment 1 Buovjaga 2024-08-25 08:32:51 UTC
Bibisecting with linux-64-24.2, the first state change was from unformatted to *nothing at all* in commit 0bb20afe3590838ba8aef204033ac95a047ba710
cool#8023 editeng: support HTML paste

The current state started with 536096309f78de9eabac38ffb9c04bff95ea7d91
tdf#159507 editeng: support pasting HTML fragments

I see these were backports, so changing version to 24.8.

The change seems intentional, so not marking as regression until we get comments from Miklos.
Comment 2 Buovjaga 2024-08-25 09:35:18 UTC
molnarszilard: I forgot to mention that you can always paste as unformatted when using the formula input line above the column headers. So even if you already started editing a cell, you can switch the focus to the input line and paste unformatted text.
Comment 3 molnarszilard 2024-08-26 06:17:25 UTC
Thank you for your answer!

Since it seems like this is the intended behavior and switching the Ctrl+V shortcut is a decent workaround for me, I am closing this issue.

If someone else misses the original behavior, then the thread can be reopened.

Keep up the good work!
Comment 4 Xisco Faulí 2024-08-26 07:28:01 UTC
(In reply to molnarszilard from comment #3)
> Thank you for your answer!
> 
> Since it seems like this is the intended behavior and switching the Ctrl+V
> shortcut is a decent workaround for me, I am closing this issue.
> 
> If someone else misses the original behavior, then the thread can be
> reopened.
> 
> Keep up the good work!

Closing as RESOLVED WONTFIX
Comment 5 Buovjaga 2024-08-26 07:43:52 UTC
Please everyone, let's keep this as unconfirmed until Miklos has time to comment!!
Comment 6 Miklos Vajna 2024-08-26 07:59:45 UTC
> In the newer 24.2.1.1 version, in both cases, the text will be pasted with the original formatting

Yes, I think this was not intentional, just the implementation of HTML paste was missing previously, so this looks like working as intended. You can always use paste special to intentionally drop formatting.
Comment 7 Buovjaga 2024-08-26 09:40:52 UTC
Thanks, now we can close and be happy.