Bug 161617 - Undoing - redoing - undoing search and replace removes paragraph direct formatting in table cell (comment 3)
Summary: Undoing - redoing - undoing search and replace removes paragraph direct forma...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Find-Search Undo-Redo
  Show dependency treegraph
 
Reported: 2024-06-17 13:48 UTC by Daniele
Modified: 2024-07-21 07:50 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
File on which to perform the test to reproduce (40.69 KB, application/vnd.oasis.opendocument.text)
2024-06-17 13:49 UTC, Daniele
Details
Video showing the bug (formatting disappears) (2.35 MB, video/mp4)
2024-06-17 13:51 UTC, Daniele
Details
minimal sample ODT (17.17 KB, application/vnd.oasis.opendocument.text)
2024-07-03 01:54 UTC, Stéphane Guillou (stragu)
Details
File with no cells (30.05 KB, application/vnd.oasis.opendocument.text)
2024-07-21 07:49 UTC, Daniele
Details
Video showing the bug (2.09 MB, video/mp4)
2024-07-21 07:50 UTC, Daniele
Details

Note You need to log in before you can comment on or make changes to this bug.
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.
Comment 5 Daniele 2024-07-21 07:49:01 UTC
Reproduced on a document with no cells, formatting is removed from all paragraph:
Steps:
0. Apply Find (regex on): 
(\s+)([\-|—|–]|\-{1,})([\x20]*)(.*?)([\x20]*)([\-|—|–]|\-{1,})
Replace:
 –⁠$4⁠–
1. Undo (cmd Z)
2. Redo (cmd shift Z)
3. Undo (cmd Z)
4. Formatting is gone
Comment 6 Daniele 2024-07-21 07:49:31 UTC
Created attachment 195427 [details]
File with no cells
Comment 7 Daniele 2024-07-21 07:50:12 UTC
Created attachment 195428 [details]
Video showing the bug