Bug 146796 - Regular Expression Undo/Redo Corruption and Lost Text
Summary: Regular Expression Undo/Redo Corruption and Lost Text
Status: RESOLVED DUPLICATE of bug 140007
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
(earliest affected) release
Hardware: All All
: medium normal
Assignee: Not Assigned
Depends on:
Blocks: Find&Replace-Regex
  Show dependency treegraph
Reported: 2022-01-16 14:44 UTC by Tex2002ans
Modified: 2022-02-03 06:04 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:
Regression By:

Basic text with empty paragraphs between. (8.60 KB, application/vnd.oasis.opendocument.text)
2022-01-16 14:46 UTC, Tex2002ans

Note You need to log in before you can comment on or make changes to this bug.
Description Tex2002ans 2022-01-16 14:44:25 UTC
Running a regular expression, then undoing/redoing multiple times, is corrupting and/or losing text.

Steps to Reproduce:
0. Open the attached document.

1. Edit > Find and Replace (Ctrl+H).

2. Make sure "Other Options" is expanded + the "Regular Expressions" box is checked.


Find: ^$
Replace: <--- Completely blank

4. Click in the first line:

	This. <--- Click in here
	And this.
	And even this.

Press Replace 3 times:

	And this.
	And even this.

5. Press Undo (Ctrl+Z) 3 times:

	And this.
	And even this.

6. Press Redo (Ctrl+Y) 3 times:

	<--- Empty Line
	<--- Empty Line

- - -

And, I haven't been able to reproduce this consistently though...

While pressing Undo/Redo a random number of times, I also arrive at:


and even more Undo/Redos lead to:


- - -

Semi-Related Bug???

I was even able to reproduce a "!!br0ken!!" + full-on crash by:

Using my attachment + following Steps 1-3 in:

- Bug #60259: Writer behaves erratically when reverse replacing $ with nothing

then undoing/redoing a few times.

Actual Results:
Whole lines of text disappear (Step 6) + some paragraph breaks aren't returned properly (Step 5) + sometimes "!!br0ken!!" text appears.

Expected Results:
Lines shouldn't get eaten.

If you replace 3 empty paragraphs and undo 3 times, you expect the text to return exactly as it was in the original document.

Reproducible: Always

User Profile Reset: No

Additional Info:
Version: (x64) / LibreOffice Community
Build ID: 499f9727c189e6ef3471021d6132d4c694f357e5
CPU threads: 8; OS: Windows 10.0 Build 19044; UI render: Skia/Vulkan; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: threaded
Comment 1 Tex2002ans 2022-01-16 14:46:36 UTC
Created attachment 177576 [details]
Basic text with empty paragraphs between.
Comment 2 Rainer Bielefeld Retired 2022-01-17 05:33:25 UTC
All details REPRODUCIBLE with  Installation of Version: (x64) Build ID 499f9727c189e6ef3471021d6132d4c694f357e5
CPU threads: 12; OS: Windows 10.0 Build 19042; UI render: Skia/Raster; VCL: win
Locale: de-DE (de_DE); UI: en-US
Calc: threaded.

a) This one is probably related to and/or DUP of "Bug 146274 - Undo after search-and-replace is br0ken"
b) In Query <https://bugs.documentfoundation.org/buglist.cgi?cmdtype=dorem&remaction=run&namedcmd=DUPs146796&sharer_id=19321> you might find some additional candidates for related Bugs.
Comment 3 Buovjaga 2022-01-17 17:50:46 UTC

*** This bug has been marked as a duplicate of bug 146274 ***
Comment 4 Mike Kaganski 2022-02-03 06:04:29 UTC

*** This bug has been marked as a duplicate of bug 140007 ***