Bug 166508 - FORMATTING: at Undo of paste a copied table the paragraph above the pasted table becomes misformatted
Summary: FORMATTING: at Undo of paste a copied table the paragraph above the pasted ta...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
24.8.6.2 release
Hardware: x86-64 (AMD64) Windows (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-05-09 13:04 UTC by Stefan_Lange_KA@T-Online.de
Modified: 2025-05-13 07:40 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
Test document to reproduce the behavior (793.83 KB, application/vnd.oasis.opendocument.text)
2025-05-09 13:04 UTC, Stefan_Lange_KA@T-Online.de
Details
zip file with Screenshots showing the steps to reproduce the bug (5.79 MB, application/x-zip-compressed)
2025-05-10 05:07 UTC, Stefan_Lange_KA@T-Online.de
Details
zip file with screenshots of modified test (3.86 MB, application/x-zip-compressed)
2025-05-10 09:00 UTC, Stefan_Lange_KA@T-Online.de
Details
style change before at the left, after at the right (576.05 KB, image/png)
2025-05-10 10:37 UTC, Mateusz Wlazłowski
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan_Lange_KA@T-Online.de 2025-05-09 13:04:22 UTC
Created attachment 200713 [details]
Test document to reproduce the behavior

When in a document with text and tables a table is copied and pasted behind a text paragraph and then is removed by undo the paragraph above the [by undo] removed table is missformatted means any made formatting is lost. 

Reproducing the behavior:
- open the attached document Test_Undo_Copy+Paste_Table V2.odt
- select the wholy table with the 2 images and text belonging to and copy it to the clipboard
- set the cursor in the line behind the text paragraph following the table
- paste the table -> it will be inserted
- undo
- the pasted table is removed, but ...

... any formatting of text paragraph above the removed table is lost (font, text alignment)
Comment 1 Stefan_Lange_KA@T-Online.de 2025-05-09 17:52:47 UTC
I have bisected the behavior in 24.2 and the result is
 fc07cf543db49b710802335f89cfade0c40859fc is the first bad commit
commit fc07cf543db49b710802335f89cfade0c40859fc
Author: Norbert Thiebaud <nthiebaud@gmail.com>
Date:   Fri Apr 12 03:33:41 2024 -0700

    source 6d3b6db240a826113a40df8cb6168816aef3441c

    source 6d3b6db240a826113a40df8cb6168816aef3441c

 instdir/program/setup.ini   |   2 +-
 instdir/program/swlo.dll    | Bin 17960448 -> 17960960 bytes
 instdir/program/version.ini |   2 +-
 3 files changed, 2 insertions(+), 2 deletions(-)
Comment 2 m_a_riosv 2025-05-09 23:53:18 UTC
But looks a similar issue than
https://bugs.documentfoundation.org/show_bug.cgi?id=76259

Can't reproduce exactly that with
Version: 25.2.3.1 (X86_64) / LibreOffice Community
Build ID: d8d1af5f77df955194e52baabe19324532ac8e8b
CPU threads: 16; OS: Windows 11 X86_64 (10.0 build 26100); UI render: Skia/Raster; VCL: win
Locale: en-US (es_ES); UI: en-US
Calc: CL threaded

But after a couple of paste and undo, make the text disappear.

BTW, please detail the exact point to paste the table.
In the next blank paragraph, at the end of the text paragrap?
Comment 3 Stefan_Lange_KA@T-Online.de 2025-05-10 05:07:50 UTC
Created attachment 200722 [details]
zip file with Screenshots showing the steps to reproduce the bug

For creating the screenshots the bug was reproduced with
Version: 25.2.4.0.0+ (X86_64) / LibreOffice Community
Build ID: b5cff69f7c6fcde2254ba88ae5582f53ed081837
CPU threads: 4; OS: Windows 11 X86_64 (10.0 build 22631); UI render: Skia/Raster; VCL: win
Locale: de-DE (de_DE); UI: de-DE
Calc: CL threaded
Comment 4 Stefan_Lange_KA@T-Online.de 2025-05-10 09:00:34 UTC
Created attachment 200726 [details]
zip file with screenshots of modified test

Because of the question for cursor position for Paste I have tested also with other cursor position, on the end of the paragraph instead on the beginning of the next paragraph.

Result:
After Paste it looks as before (table inserted behind the paragraph, "Screenshot 4V2 - after Paste.png" vs. "Screenshot 4 - after Paste.png" from zip file attached first) but by Undo not only the table is removed but also the paragraph ("Screenshot 5V2 - after Undo.png").
Comment 5 Mateusz Wlazłowski 2025-05-10 10:37:37 UTC
Created attachment 200727 [details]
style change before at the left, after at the right

I looked into spotlight and saw that in the beginning all of the paragraphs are a "modified style of table contents" and later the paragraph with the text, the style reverts to "original style of table contents" and the paragraph without text changes to "modified style of default paragraph"

Version: 25.8.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: f355ddcbf2bf037263e336724829b5467b94ef40
CPU threads: 8; OS: Linux 6.11; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded
Comment 6 Mateusz Wlazłowski 2025-05-10 11:02:48 UTC
Also confirm from attachment 200726 [details], the disappearance of the paragraph