Bug 161617

Summary: Undoing - redoing - undoing search and replace removes paragraph direct formatting in table cell (comment 3)
Product: LibreOffice Reporter: Daniele <grassode>
Component: WriterAssignee: Not Assigned <libreoffice-bugs>
Status: NEW ---    
Severity: normal CC: stephane.guillou
Priority: medium    
Version: Inherited From OOo   
Hardware: All   
OS: All   
Whiteboard:
Crash report or crash signature: Regression By:
Bug Depends on:    
Bug Blocks: 102847, 105948    
Attachments: File on which to perform the test to reproduce
Video showing the bug (formatting disappears)
minimal sample ODT

Description Daniele 2024-06-17 13:48:31 UTC
Description:
When doing a search and replace (of italics in my case) in a cell, if one undoes the changes, reapplies them and undoes them again, the whole formatting of the cell disappears. 

Steps to Reproduce:
1.Apply search and replace (3 times for ex.) in a cell where italics (for ex.) are present (file provided below)
2. Undo the replacements
3. Redo the replacements
4. Undo them 

Actual Results:
At this point the formatting of the cell disappears.

Expected Results:
Everything should remain the same except what is concerned by the search and replace undo and redo.


Reproducible: Always


User Profile Reset: No

Additional Info:
Version: 24.2.4.2 (AARCH64) / LibreOffice Community
Build ID: 51a6219feb6075d9a4c46691dcfe0cd9c4fff3c2
CPU threads: 8; OS: macOS 14.5; UI render: Skia/Metal; VCL: osx
Locale: en-US (en.UTF-8); UI: en-US
Calc: threaded
Comment 1 Daniele 2024-06-17 13:49:21 UTC
Created attachment 194779 [details]
File on which to perform the test to reproduce
Comment 2 Daniele 2024-06-17 13:51:28 UTC
Created attachment 194780 [details]
Video showing the bug (formatting disappears)
Comment 3 Stéphane Guillou (stragu) 2024-07-03 01:54:23 UTC
Created attachment 195093 [details]
minimal sample ODT

Thanks for the report. I can reproduce but I have attempted to create a minimal test file with more precise steps to pinpoint the issue.
With the sample file attached here:

1. Open attachment
2. Open Find & Replace dialog (Ctrl + H)
3. In Find field: input a full stop (".")
4. Nothing in Replace field
5. Other fields not changed from defaults (no regular expressions, no use of Format...)
6. Click "Replace" twice (effectively only replacing one full stop)
7. Undo once
8. Redo once
9. Undo once

Result: Paragraph in table cell now uses Palatino Linotype (fallback) font instead of the original Times-Roman (fallback) font; italic is lost.
Note that Palatino Linotype is used outside the table, and is the default font for the paragraph style in use.

Looks like the sequence simply removes all direct formatting from the table cell.

Version: 24.2.4.2 (X86_64) / LibreOffice Community
Build ID: 51a6219feb6075d9a4c46691dcfe0cd9c4fff3c2
CPU threads: 8; OS: Linux 6.5; UI render: default; VCL: gtk3

Version: 25.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 70b3e128aef631e18e6451362c2e6315c28b857e
CPU threads: 8; OS: Linux 6.5; UI render: default; VCL: gtk3
Comment 4 Stéphane Guillou (stragu) 2024-07-03 01:56:35 UTC
Reproduced in OOo 3.3 -> inherited.