Bug 98440 - Pasting a horizontal range of table cells with merged "undoes" merging, duplicates data
Summary: Pasting a horizontal range of table cells with merged "undoes" merging, dupli...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium major
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
: 171335 (view as bug list)
Depends on:
Blocks: Paste Writer-Tables Cell-Management
  Show dependency treegraph
 
Reported: 2016-03-05 06:44 UTC by Jim Avera
Modified: 2026-03-18 08:20 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
sample odt file (9.57 KB, application/vnd.oasis.opendocument.text)
2016-03-06 18:30 UTC, Usama
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jim Avera 2016-03-05 06:44:01 UTC
If a row is copied and pasted onto another row in a Table, the text and formatting is copied as expected.

However merged cells are un-merged, so the text ends up in the wrong columns, and some text is duplicated.

STEPS TO REPRODUCE:

1. Start Writer, insert a table with (say) 5 rows and 5 columns
2. Select two adjacent cells in a row, click the "Merge" icon (or Table->Merge).\

   Insert unique text into every visible cell in the row

3. Select all cells in the row.  Control-C to copy
4. Select all cells in another row.  Control-P to paste

RESULTS:  The merged-ness of the copied cells is lost, and text is pasted into the wrong cells.  Text in the first column is duplicated in the last column

EXPECTED RESULTS: The pasted-onto row should look exactly like the source row.
Comment 1 Usama 2016-03-06 18:30:12 UTC
Created attachment 123352 [details]
sample odt file

Hello Jim,

Thank you for reporting the bug. I can confirm that the bug is present in master.
sample file is attached.

I noticed that after pasting the content of the newly created cell after splitting is copied from the first cell in the row.

Version: Version: 5.2.0.0.alpha0+
OS: Ubuntu 15.10
Comment 2 QA Administrators 2018-07-02 02:36:44 UTC Comment hidden (obsolete)
Comment 3 Jim Avera 2018-07-02 07:11:18 UTC
Bug is still present in master (6.2.0.0.alpha0 of 7/1/2018)
Comment 4 Timur 2018-12-24 17:09:08 UTC
Still in 6.3+. This is data loss.
Comment 5 BogdanB 2022-01-27 21:02:02 UTC
Still here,
Retested with 7.4

Version: 7.4.0.0.alpha0+ / LibreOffice Community
Build ID: 2f4f4cbeb8e50081d607b86b0475b93971c40ab8
CPU threads: 16; OS: Linux 5.13; UI render: default; VCL: gtk3
Locale: ro-RO (ro_RO.UTF-8); UI: en-US
Calc: threaded
Comment 6 Anandhi k 2023-02-01 07:25:11 UTC
yes Reproduced
 
STEPS TO REPRODUCE:

1. Start Writer, insert a table with (say) 5 rows and 5 columns
2. Select two adjacent cells in a row, click the "Merge" icon (or Table->Merge).\

   Insert unique text into every visible cell in the row

3. Select all cells in the row.  Control-C to copy
4. Select all cells in another row.  Control-P to paste

RESULTS:  The merged-ness of the copied cells is lost, and text is pasted into the wrong cells.  Text in the first column is duplicated in the last column

EXPECTED RESULTS: The pasted-onto row should look exactly like the source row.

I had a commplicate with result if i use control-v instead of control -p in got a excepted result 


Environment:Linux Mint 21 Cinnamon
Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 620ad1b7ae06d6f053fb2c9b57af96b736c04e57
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-IN (en_IN); UI: en-US
Calc: threaded
Comment 7 QA Administrators 2025-02-01 03:12:26 UTC Comment hidden (obsolete)
Comment 8 Eyal Rozenberg 2026-03-16 10:07:22 UTC
*** Bug 171335 has been marked as a duplicate of this bug. ***
Comment 9 Eyal Rozenberg 2026-03-16 10:31:40 UTC
A few observations:

* This happens when copying any (horizontal) range of cells containing a merged cell, onto a corresponding horizontal range in another row. It can be the entire line, part of the line, or just the merged cell itself. For example, in attachment 123352 [details], copy just the second cell (a merging of columns 2 and 3), containing "Ttt", onto the second and third cells of the first row, which are not merged. The result will be two cells, not one merged cell; and the contents will be "Ttt" in each of the two cells.
* One could argue that the duplication is a definite bug, and the question of what to do with the merged cell is more of a behavior change request than a bug per se. Adapting what I wrote on the dupe bug, the following seem to me like legitimate behaviors when pasting a range with n-1 cells, one of which is the result of merging 2 cells, onto a range of n cells:

1. Paste the source (n-1-cell) range onto the first n-1 cells of the selected range; do not change any cell widths; do not touch the n'th target cell.
2. Paste the source (n-1-cell) range onto the first n-1 cells of the selected range;  clear the contents of the n'th range cell (as though it had been selected and Delete was pressed).
3. Refuse to paste due to the incompatible range sizes (problematic, but avoids undesirable action)
4. Merge the appropriate two cells of the target range, then copy the corresponding contents between n-1 and n-1 cells.
5. Open a dialog asking what to do (and offer some of the options above).

Independently of the above, this may be an opportunite for placing a hovering mini-toolbar/mini-buttonmenu, like MSO offers after some paste operations.