Bug 154152 - Paste-Special > Text, Number or Formula does nothing when data copied from other app
Summary: Paste-Special > Text, Number or Formula does nothing when data copied from ot...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
7.6.0.0 alpha0+
Hardware: All Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Paste-Special
  Show dependency treegraph
 
Reported: 2023-03-12 21:38 UTC by Eyal Rozenberg
Modified: 2023-04-04 21:00 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 Eyal Rozenberg 2023-03-12 21:38:20 UTC
I have a text editor open, and have copied the string "5678".

In a new Calc spreasheet, I now try to paste this content in different ways, into some arbitrary cell.

Pressing Ctrl+V:                                  Works, I get 5678.
Right-click > Paste:                              Works, I get 5678.
Right-click > Paste Special > Unformatted Text :  Works, I get 5678.
Right-click > Paste Special > Text :              Nothing happens!
Right-click > Paste Special > Number :            Nothing happens!
Right-click > Paste Special > Formula :           Nothing happens!

Seeing this with:

Version: 7.5.0.3 (X86_64) / LibreOffice Community
Build ID: c21113d003cd3efa8c53188764377a8272d9d6de
CPU threads: 4; OS: Linux 6.1; UI render: default; VCL: gtk3
Locale: en-IL (en_IL); UI: en-US
Calc: CL threaded

and:

Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: ad387d5b984c6666906505d25685065f710ed55d
CPU threads: 4; OS: Linux 6.1; UI render: default; VCL: gtk3
Locale: he-IL (en_IL); UI: en-US
Calc: threaded
Comment 1 Lesline 2023-03-13 05:14:59 UTC
Hello Eval.

Thank you for reporting the bug.

I can confirm that I was able to reproduce the bug using the steps you provided.  

The versions tested are as follows:

Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: a834bbad8295cba0ca88a91a524aad48640271ec
CPU threads: 8; OS: Windows 10.0 Build 19044; UI render: Skia/Raster; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: threaded

Version: 7.5.0.3 (X86_64) / LibreOffice Community
Build ID: c21113d003cd3efa8c53188764377a8272d9d6de
CPU threads: 8; OS: Windows 10.0 Build 19044; UI render: Skia/Raster; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: threaded

Kind Regards
Comment 2 Stéphane Guillou (stragu) 2023-03-13 08:54:25 UTC
I don't think this is a bug. If you have three cells that contain:

567
abc
=123

... and you copy and paste those with paste special > Text / Number / Formula, you will see the different results.

These Paste Special options are more for in-app pastes. See documentation here:

https://help.libreoffice.org/7.6/en-US/text/shared/01/02070000.html

In essence, these are not about pasting *as* something, but they are about pasting *only* something.

What I can see as potential improvement here:
- naming of those options. Should we use "Text only / Numbers only / Formulas only" ?
- what should happen when the data comes from an external application? Like here, should an exclusively numeric string copied from a text editor be pasted when "Numbers" is selected? Another example: when copying from Gnumeric, with the same 3 cell contents above, all three options paste nothing.

Copying UX/UI for opinion regarding my two questions above.
Comment 3 Eyal Rozenberg 2023-03-13 09:22:53 UTC
(In reply to Stéphane Guillou (stragu) from comment #2)
> I don't think this is a bug. If you have three cells that contain:
> 
> 567
> abc
> =123
> 
> ... and you copy and paste those with paste special > Text / Number /
> Formula, you will see the different results.

I don't have any of that stuff. My clipboard contains "5678". No new-lines, no characters, no space, no nothing.


> These Paste Special options are more for in-app pastes.

Either they are _only_ for in-app pastes, in which case they should be grayed-out for out-of-app contents; or they are also for out-of-app pastes, in which case my text should have been pasted.

> In essence, these are not about pasting *as* something, but they are about
> pasting *only* something.

1. The clipboard content in my case qualifies as at least two out of the three categories.
2. That's not what the names suggest. <- addressed by your improvement idea.
3. That's not what MS Excel does AFAICR.
Comment 4 Stéphane Guillou (stragu) 2023-03-13 10:25:25 UTC
(In reply to Eyal Rozenberg from comment #3)
> (In reply to Stéphane Guillou (stragu) from comment #2)
> > I don't think this is a bug. If you have three cells that contain:
> > 
> > 567
> > abc
> > =123
> > 
> > ... and you copy and paste those with paste special > Text / Number /
> > Formula, you will see the different results.
> 
> I don't have any of that stuff. My clipboard contains "5678". No new-lines,
> no characters, no space, no nothing.

My point was only to demonstrate what these options work well for, i.e. a range of Calc cells.

> 
> > These Paste Special options are more for in-app pastes.
> 
> Either they are _only_ for in-app pastes, in which case they should be
> grayed-out for out-of-app contents; or they are also for out-of-app pastes,
> in which case my text should have been pasted.
> 

Very good point. Maybe the easiest fix would be to (1) append names with "only" and (2) gray out for external data.

Noting that the options don't work either with my example data between MS Excel and LO Calc.

Changed the summary and setting to New, there is clearly something to do about it.
Comment 5 Heiko Tietze 2023-03-13 10:33:39 UTC
(In reply to Eyal Rozenberg from comment #3)
> I don't have any of that stuff. My clipboard contains "5678".

The point is that 5678 is not text (neither when copying from external sources nor from internal content) and is not a formula. You tell the paste special function explicitly to not past numbers. => NAB
Comment 6 ady 2023-03-13 10:57:42 UTC
(In reply to Eyal Rozenberg from comment #0)
> In a new Calc spreasheet, I now try to paste this content in different ways,
> into some arbitrary cell.
> 
> Pressing Ctrl+V:                                  Works, I get 5678.
> Right-click > Paste:                              Works, I get 5678.
> Right-click > Paste Special > Unformatted Text :  Works, I get 5678.
> Right-click > Paste Special > Text :              Nothing happens!
> Right-click > Paste Special > Number :            Nothing happens!
> Right-click > Paste Special > Formula :           Nothing happens!

Please note that you can paste "any" kind of values when the origin is some plain text.

For instance, you can select the Unformatted Text alternative and then choose different types of data per column.

Unformatted Text doesn't care whether you are copying from within Calc, or from any other source; but the other alternatives do.

I think that the potential confusion, as others mentioned, is that "Unformatted Text" seems to be in the same "category" as the others; it is not – not really. Unformatted Text pastes from "any" source, whereas the others are from other cells, limiting the result according to type of data in the source cells. IIRC, they used to be within the Paste Special dialog only, and the fact that they are now accessed more easily directly in the menu might had triggered this potential confusion.

I agree with others; by itself this is NAB, but perhaps the idea of graying out these alternative options when they are not really usable/relevant/adequate might be a valid improvement.
Comment 7 Eyal Rozenberg 2023-03-13 11:15:07 UTC
(In reply to Heiko Tietze from comment #5)
> The point is that 5678 is not text (neither when copying from external
> sources nor from internal content)

It is text. It's textual characters copied from a text editor.

> and is not a formula.

Well, it _is_ technically a formula - one doesn't involve any invocation of functions. But I won't quibble over this one.

> You tell the paste special function explicitly to not past numbers.

1. I don't tell it that... or am I misunderstanding this sentence?
2. Even when I choose Paste Special > Number, nothing is pasted.
Comment 8 Eyal Rozenberg 2023-03-13 11:20:52 UTC
(In reply to ady from comment #6)
> I agree with others; by itself this is NAB, but perhaps the idea of graying
> out these alternative options when they are not really
> usable/relevant/adequate might be a valid improvement.

grayed-out would not be a bug, usable would not be a bug, but active and unusable, especially with labels suggesting usability - that's the bug.
Comment 9 Eike Rathke 2023-03-13 17:34:44 UTC
The Calc data specific slots must be disabled if the clipboard does not offer a Calc data source.
Comment 10 Heiko Tietze 2023-03-14 07:44:01 UTC
So let's disable this function.