Bug 106177 - Paste special of Only Formulas unmerges cells (steps in Comment 9)
Summary: Paste special of Only Formulas unmerges cells (steps in Comment 9)
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: low minor
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Cell-Formula Calc-Merge-Split Paste-Special
  Show dependency treegraph
 
Reported: 2017-02-24 16:29 UTC by James B. Byrne
Modified: 2023-04-06 13:01 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
Example of merged cells split by formula paste (14.92 KB, application/vnd.oasis.opendocument.spreadsheet)
2017-02-28 19:16 UTC, James B. Byrne
Details
gdb trace of formula paste splitting merged cells (1.67 KB, text/x-log)
2017-03-10 16:58 UTC, James B. Byrne
Details

Note You need to log in before you can comment on or make changes to this bug.
Description James B. Byrne 2017-02-24 16:29:34 UTC
If a formula is entered into a cell that has been merged with adjacent cells and that cell is then copied and pasted (special) into another group of merged cells with only the formula specified then the merged target cells are split.  They then need to be manually merged again.

This happens if only one group of merged cells are copied from/to or if an entire row is copied.  If the formatting is copied as well then the format from the source is properly applied to the target, which in the present case, is not desired.

This happens on Linux as well as the Microsoft versions of LO.
Comment 1 Xisco Faulí 2017-02-26 21:49:57 UTC Comment hidden (obsolete)
Comment 2 James B. Byrne 2017-02-28 19:16:37 UTC
Created attachment 131543 [details]
Example of merged cells split by formula paste

This a simple ods with merged cells in three columns.  The centre cell at row ten column 2 had the formula from cell row 2, column 2 copied and then the formula only pasted into it.  Th result is that the formerly meged cells at that location are now split.
Comment 3 James B. Byrne 2017-03-10 16:58:36 UTC
Created attachment 131801 [details]
gdb trace of formula paste splitting merged cells

The request trace from LibreOffice-5.3 is attached.  

Installed Packages
Name        : libreoffice5.3
Arch        : x86_64
Version     : 5.3.0.3
Release     : 3
Size        : 4.3 M
Repo        : installed
From repo   : /libreoffice5.3-5.3.0.3-3.x86_64
Summary     : Brand module for LibreOffice 5.3 .0.3
License     : LGPL
Description : Brand module for LibreOffice 5.3
Comment 4 Xisco Faulí 2017-03-10 18:52:59 UTC
Confirmed in

Version: 5.4.0.0.alpha0+
Build ID: 5f33745c1d6750126e53a02b2a95355a3e5b16a0
CPU Threads: 4; OS Version: Linux 4.8; UI Render: default; VCL: gtk2; 
Locale: ca-ES (ca_ES.UTF-8); Calc: group

Steps to reproduce:
1. Open attach document
2. Merge 3 columns in E:22 to H:22
3. Copy E4
4. Paste special in E:22

Result: Merged cells get split.
Comment 5 Xisco Faulí 2017-03-10 19:19:04 UTC Comment hidden (obsolete)
Comment 6 Xisco Faulí 2017-03-10 19:23:37 UTC
Ok, so looking at the commit, this is not a bug. it's just that when you use the Special copy, format option is not enabled, if you enable it, then the cells aren't split.
Closing as RESOLVED NOTABUG
Comment 7 James B. Byrne 2017-03-13 15:37:32 UTC
You have not read the initial report.  The only thing being copied and pasted in IS formula.  I can assure you that the formula box is checked when this happens and that nothing else is.
Comment 8 James B. Byrne 2017-03-13 15:40:50 UTC
In any case, why would copying and pasting text and numbers without format split merged cells in the target as an expected behaviour?
Comment 9 Buovjaga 2017-03-23 11:48:25 UTC
Clarified steps to reproduce:
1. Open attachment 131543 [details]
2. Merge the cells E22 to H22
3. Copy E4
4. Paste special in E22, only tick the Formulas checkbox

Result: Merged cells get split.

Not related to the commit mentioned in comment 5 as this already happens in 3.5.

Win 7 Pro 64-bit Version: 5.4.0.0.alpha0+
Build ID: 1670cc25bc2771e87f7956a4b0dd634abaa4128b
CPU threads: 4; OS: Windows 6.1; UI render: default; 
TinderBox: Win-x86@42, Branch:master, Time: 2017-03-22_23:28:42
Locale: fi-FI (fi_FI); Calc: CL

LibreOffice 3.5.0rc3 
Build ID: 7e68ba2-a744ebf-1f241b7-c506db1-7d53735
Comment 10 QA Administrators 2018-03-24 03:31:40 UTC Comment hidden (obsolete)
Comment 11 Timur 2018-12-28 09:15:08 UTC
Repro 6.3+.
Comment 12 QA Administrators 2020-12-28 03:43:42 UTC Comment hidden (obsolete)
Comment 13 James B. Byrne 2020-12-29 15:56:07 UTC Comment hidden (obsolete)
Comment 14 Roland Kurmann 2021-04-04 21:37:33 UTC
As far as I understand the LibreOffice source code, i.e. the data model: merging of cells is part of the cell format (style). So, if you do not paste the format, you loose your merge cell information.

In this logic, the current behavior is correct.

So, I agree with Xisco Fauli with Closing as RESOLVED NOTABUG in comment 6.
Comment 15 Buovjaga 2021-04-05 05:33:23 UTC
(In reply to Scito from comment #14)
> As far as I understand the LibreOffice source code, i.e. the data model:
> merging of cells is part of the cell format (style). So, if you do not paste
> the format, you loose your merge cell information.
> 
> In this logic, the current behavior is correct.
> 
> So, I agree with Xisco Fauli with Closing as RESOLVED NOTABUG in comment 6.

But if you do Paste Special - Unformatted text, there is no destruction of the merged format. So why should Paste Special - Values only destroy it?
Comment 16 Roland Kurmann 2021-04-05 14:31:28 UTC
(In reply to Buovjaga from comment #15)
> But if you do Paste Special - Unformatted text, there is no destruction of
> the merged format. So why should Paste Special - Values only destroy it?

I misunderstood. Yeah, you are right. This is unexpected.
Comment 17 QA Administrators 2023-04-06 03:24:08 UTC Comment hidden (obsolete)
Comment 18 James B. Byrne 2023-04-06 13:01:59 UTC
Version: 7.4.4.2 / LibreOffice Community
Build ID: 40(Build:2)
CPU threads: 16; OS: FreeBSD 12.4; UI render: default; VCL: qt5 (cairo+xcb)
Locale: en-CA (C); UI: en-US
Calc: threaded