Bug 41113 - EDITING: Using "Paste special" in merged cells loses cell content
Summary: EDITING: Using "Paste special" in merged cells loses cell content
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: Other All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
: 131385 (view as bug list)
Depends on:
Blocks: Calc-Merge-Split Paste-Special
  Show dependency treegraph
 
Reported: 2011-09-22 05:19 UTC by Stephan van den Akker
Modified: 2023-05-11 16:01 UTC (History)
8 users (show)

See Also:
Crash report or crash signature:


Attachments
Screen after paste special (10.80 KB, image/png)
2023-03-30 15:22 UTC, Andreas Heinisch
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Stephan van den Akker 2011-09-22 05:19:57 UTC
How to reproduce:
Create new spreadsheet
Fill cells Sheet1.A1:C1 with unique numbers, e.g. 1 to 3
Merge cells Sheet2.A1:B1 and Sheet2.C1:D1
Select cells Sheet1.A1:C1 and select Edit | Copy 
Select cell Sheet2.A1 and select Edit | Paste Special...
In Dialog "Paste Special" unselect "Paste all" under Selection
In Dialog "Paste Special" unselect everything except "Numbers" under Selection
In Dialog "Paste Special" press OK

Expected behavior:
Merged cell Sheet2.A1:B1 contains 1
Merged cell Sheet2.C1:D1 contains 2
Cell Sheet2.E1 contains 3

Actual behaviour:
Merged cell Sheet2.A1:B1 contains 1
Merged cell Sheet2.C1:D1 contains 3
Cell Sheet2.E1 is empty
Comment 1 Björn Michaelsen 2011-12-23 12:39:10 UTC Comment hidden (obsolete)
Comment 2 Stephan van den Akker 2011-12-23 14:39:39 UTC
Bug is still there.

Tested in LOdev 3.5.0 
Build ID: 7362ca8-b5a8e65-af86909-d471f98-61464c4
on openSuSE 11.4 32-bit
Comment 3 Rainer Bielefeld Retired 2012-03-06 00:40:44 UTC
I see the effect with "LibreOffice 3.5.1.1 German UI/Locale [Build-ID: 45a2874-aa8c38d-dff3b9c-def3dbd-62463c8] on German WIN7 Home Premium (64bit), but I can't tell whether it's a bug, although the result is unexpected also for me.

@Stephan van den Akker
You did some chin-ups to get the undesired result, can you explain why you did exactly so? Can you cite Help, manuals or similar that let expect other behavior?
Comment 4 Stephan van den Akker 2012-03-06 05:21:15 UTC
@Rainer Bielefeld: Good questions.

Copying cell content without formatting is something I use a lot. It is an invaluable part of a workflow that re-uses heavily formatted sheets with new data.

Writer actually behaves in the way i would expect and prefer for Calc (see "Expected behavior" in my original post).

But, then Calc's help on merging cells says:

"You can select adjacent cells, then merge them into a single cell. Conversely, you can take a large cell that has been created by merging single cells, and divide it back into individual cells.

When you copy cells into a target range containing merged cells, THE TARGET RANGE GETS UNMERGED FIRST, then the copied cells are pasted in. If the copied cells are merged cells, they retain their merge state." (capitalization mine)

I guess the second paragraph is trying to tell me to expect the actual behavior, but it still doesn't make sense to me. It just seems to me that the user is exposed to the implementation details of merging.

I would prefer and expect merged cells to behave as a single cell, just as the first help paragraph says and just like in Writer. I like programs with little or no exceptions to their own base rules (just like a good Sci Fi movie...).

How do other speadsheets do it:

Excel 97, Excel 2007, Gnumeric: Error message, whining about the target range not being compatible with the copied content. No copying possible...

Calligra Tables: same as present behavior of Calc

So, to recap, my arguments to change Calc's behavior:
1: I expect merged cells to behave as 1 cell
2: Writer does it the way I prefer: Calc is behaving inconsistenly
3: Calc's behavior is unexpected for you too (that makes 2 out of 2). 

But basically, it comes down to taste and consistency. What do
other users expect?
Comment 5 Cor Nouws 2012-05-10 04:32:07 UTC
(In reply to comment #4)

> But, then Calc's help on merging cells says:
> [...] 
> When you copy cells into a target range containing merged cells, THE TARGET
> RANGE GETS UNMERGED FIRST, then the copied cells are pasted in. If the copied
> cells are merged cells, they retain their merge state." (capitalization mine)

I think this explains that just doing Paste (and not paste special) results in 
Sheet2.A1 = 1, B1 = 2 and C1 = 3


> So, to recap, my arguments to change Calc's behavior:
> 1: I expect merged cells to behave as 1 cell
> 2: Writer does it the way I prefer: Calc is behaving inconsistenly
> 3: Calc's behavior is unexpected for you too (that makes 2 out of 2). 
> 
> But basically, it comes down to taste and consistency. What do
> other users expect?

I think this is a useful idea.
Comment 6 Joel Madero 2016-07-04 06:29:39 UTC
Version: 5.3.0.0.alpha0+
Build ID: c89294233b6a9ffc1bd75e6e9226ad723b7d5538
CPU Threads: 2; OS Version: Linux 3.16; UI Render: default; 
Locale: en-US (en_US.UTF-8)


Same behavior. 

I'm not sure why this is an enhancement and not a bug. Having 1 value just missing entirely on a paste seems like a strange default behavior (wrong) but...I won't change it. If someone else thinks it should be changed I suspect:

Minor: Can slow down but won't prevent high quality work;
Lowe: Default for minor bugs seems appropriate
Comment 7 QA Administrators 2018-06-04 02:33:58 UTC Comment hidden (obsolete)
Comment 8 Timur 2018-12-28 09:14:35 UTC Comment hidden (obsolete)
Comment 9 Timur 2020-03-24 10:04:55 UTC
Repro 7.0+.
Comment 10 Timur 2020-03-24 10:41:33 UTC
*** Bug 131385 has been marked as a duplicate of this bug. ***
Comment 11 romrodz77@outlook.com 2020-03-24 11:23:38 UTC
Versión: 6.4.1.2 (x64)
Id. de compilación: 4d224e95b98b138af42a64d84056446d09082932
Subprocs. CPU: 8; SO: Windows 10.0 Build 18363; Repres. IU: GL; VCL: win; 
Configuración regional: es-ES (es_ES); Idioma de IU: es-ES
Calc: CL

The bug is still present.
Comment 12 QA Administrators 2022-03-25 03:39:12 UTC Comment hidden (obsolete)
Comment 13 Rainer Bielefeld Retired 2022-03-25 06:36:10 UTC
😥
Comment 14 Stephan van den Akker 2022-03-31 13:52:01 UTC
Bug is still present in:

Version: 7.4.0.0.alpha0+ / LibreOffice Community
Build ID: 59af0be9fbfcef4e157a74099a6aef0c60facb36
CPU threads: 16; OS: Linux 5.16; UI render: default; VCL: kf5 (cairo+xcb)
Locale: en-GB (en_GB.UTF-8); UI: en-GB
Calc: threaded
Comment 15 Andreas Heinisch 2023-03-30 15:22:11 UTC
Created attachment 186324 [details]
Screen after paste special

I cannot repor in:
Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 98cf5157d69d9f1692be7f2cac958b1dfb387ca9
CPU threads: 6; OS: Windows 10.0 Build 19044; UI render: default; VCL: win
Locale: de-DE (de_DE); UI: en-US
Calc: CL threaded

It shows me the following after the paste special dialog.
Comment 16 Andreas Heinisch 2023-05-11 14:37:34 UTC
I will close this one since I am unable to reproduce it in:
Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 1d532b15472f42bda831c5404f78f92725e66e83
CPU threads: 16; OS: Windows 10.0 Build 19044; UI render: Skia/Raster; VCL: win
Locale: de-DE (de_DE); UI: en-US
Calc: CL threaded

Feel free to open it again if my testing was wrong.
Comment 17 ady 2023-05-11 16:01:54 UTC
(In reply to Andreas Heinisch from comment #16)
> I will close this one since I am unable to reproduce it in:
> Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
> Build ID: 1d532b15472f42bda831c5404f78f92725e66e83
> CPU threads: 16; OS: Windows 10.0 Build 19044; UI render: Skia/Raster; VCL:
> win
> Locale: de-DE (de_DE); UI: en-US
> Calc: CL threaded
> 
> Feel free to open it again if my testing was wrong.

FWIW, if you are basing that on your screenshot from attachment 186324 [details] in comment 15, then that's not how the report was presented: your screenshot shows pasting down, whereas the steps are pasting right-ways.

Having said that, I think we cannot call the current behavior a bug. The values from cells A1, A2 and A3 from Sheet1 are pasted into cells A1, A2 and A3 in Sheet2.

In order to see the second value, just unmerge Sheet2.A1:A2.

I am aware of the "do not paste formatting" matter, but then someone will ask for the exact opposite behavior. And, there are alternative ways to obtain different results regarding merged cells.

Instead, there should be a clear method to get the described desired result, but it should not be the default. The options in Paste Special have changed since comment 0 was first written, more than a decade ago.

I'll leave someone else decide whether to change the status to RFE (for documentation, or for adding more options, or whatever), or to WF.