Bug 136577 - [EDITING] "Replace All" does not undo properly if the replacement string is empty
Summary: [EDITING] "Replace All" does not undo properly if the replacement string is e...
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
6.4.6.2 release
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Michael Stahl (allotropia)
URL:
Whiteboard: target:7.1.0 target:7.0.3
Keywords: bibisected, bisected, regression
: 136580 (view as bug list)
Depends on:
Blocks:
 
Reported: 2020-09-08 17:45 UTC by Matt McCutchen
Modified: 2020-10-20 22:40 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matt McCutchen 2020-09-08 17:45:16 UTC
Description:
After a "Replace All" command in which the replacement string is empty, "Undo" does not correctly restore the previous state.  In some cases (as in the steps to reproduce here), "Undo" does nothing at all.  In others, I've seen it change some formatting but still not restore the previous state.

Steps to Reproduce:
1. Create a new Writer document.
2. Type in the single character "x".
3. Go to "Edit" -> "Find and Replace".
4. In "Find", type "x".  Leave "Replace" empty.
5. Click "Replace All" and then close the dialog box.
6. Click "Undo" on the toolbar.


Actual Results:
"Undo" does nothing.

Expected Results:
"Undo" brings back the "x" that was removed by "Replace All".


Reproducible: Always


User Profile Reset: Yes



Additional Info:
Bug reproduced in:
- libreoffice-6.4.6.2-1.fc32.x86_64 (Fedora 32)
- libreoffice7.0-7.0.1.2-2.x86_64 downloaded from the home page today
- Nightly build master~2020-09-07_09.02.58_LibreOfficeDev_7.1.0.0.alpha0_Linux_x86-64_rpm.tar.gz

Bug does not occur in:
- Apache_OpenOffice_4.1.7_Linux_x86-64_install-rpm_en-US.tar.gz
Comment 1 Telesto 2020-09-08 19:47:59 UTC
*** Bug 136580 has been marked as a duplicate of this bug. ***
Comment 2 Telesto 2020-09-08 19:48:27 UTC
Version: 7.1.0.0.alpha0+ (x64)
Build ID: e8b8e7be0b2ad693224cd94062a55610eb69df7e
CPU threads: 4; OS: Windows 6.3 Build 9600; UI render: Skia/Raster; VCL: win
Locale: nl-NL (nl_NL); UI: en-US
Calc: CL
Comment 3 Attila Baraksó (NISZ) 2020-09-16 06:43:46 UTC
Bibisected using bibisect-win64-7.1 to:
URL: https://cgit.freedesktop.org/libreoffice/core/commit/?id=e1629c210ad78310e3d48c0756723134a27b89df
author: Michael Stahl <Michael.Stahl@cib.de>
committer: Michael Stahl <Michael.Stahl@cib.de>
summary: tdf#131912 sw: fix spell check correct deleting flys

Adding CC: Michael Stahl
Comment 4 Commit Notification 2020-10-14 16:34:38 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/d3eca4177a78c3db17b4699ea6e071e52488c46f

tdf#136577 sw: fix Undo of Replace with nothing

It will be available in 7.1.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 5 Michael Stahl (allotropia) 2020-10-14 16:35:22 UTC
fixed on master
Comment 6 Matt McCutchen 2020-10-14 16:42:02 UTC
Thanks Michael!  I felt bad for you with your sequence of commits, each of which caused a regression that had to be fixed by the next one, which doesn't surprise me with this staggeringly complex codebase.  I'm glad this fix was so simple; hopefully it will be the last of this particular sequence. :)

I imagine you've already tested the code, but FWIW, I'll test the nightly build with the fix when it comes out.
Comment 7 Matt McCutchen 2020-10-14 16:55:07 UTC
I should add, thanks to everyone who helped triage the issue too.
Comment 8 Commit Notification 2020-10-14 19:40:41 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "libreoffice-7-0":

https://git.libreoffice.org/core/commit/ba5584a3ce86c2db52e2e4a4b91254741b2616ec

tdf#136577 sw: fix Undo of Replace with nothing

It will be available in 7.0.3.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 9 Commit Notification 2020-10-14 20:22:11 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/c064766901722082df0d759c95434c1460fcdba5

tdf#136577: sw: Add UItest

It will be available in 7.1.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 10 Xisco Faulí 2020-10-15 14:43:24 UTC
Verified in

Version: 7.1.0.0.alpha0+
Build ID: e897fdc46b07f211c4c96de103cfa494b645035a
CPU threads: 4; OS: Linux 5.7; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded

@Michael Stahl, thanks for fixing this issue!!
Comment 11 Matt McCutchen 2020-10-20 22:40:39 UTC
I verified the fix too in master~2020-10-19_17.49.49_LibreOfficeDev_7.1.0.0.alpha0_Linux_x86-64_rpm.tar.gz .