Steps to Reproduce:
1. Write some text in a couple of non-adjacent Calc cells
2. Select that range of cells also including some empty cells
3. From the Edit menu, open the Find & Replace tool.
4. Leave "Find" empty and put something in "Replace" field
5. With Current selection only, do Replace All
6. Hit Undo
Undo removes text you wrote in step 1.
Undo should remove what's replaced.
No repro LO 3.6, repro 4.1. Regression in 41 repo.
Seems like undo was first broken.
The first bad commit could be any of: 16ad2cb45e4da4b1998ab0a0b2a0666d8cdb94af 2b1daaecf419c7317e2d38e8e147a621cb8355cb 14b403221ce70a750cd9e519dfd63d5ebd6ae45c ee124800ec44ccf052c1f361f2c922d5c8489ae1 5fe765bc247e4f0620b11f9f38c1d74fdbfae3b4 b22ba348e40cded78dd65d1307988322173f1f0d 063be8e5addb6996e9ed0d225625ea1946143b28 08481403deeb8b6f1142ed424807fe16a73db54f 8e0706434735f82240f4fa6fafef01e7e6334040 b15b3ca4a51150e40d65248bf814044ed02e5571 55fd221299240469da87659d032b938d4fffdc0f 5f483290e0ead1b7168c0d5014cbe20b6eacb5bc 17ebfc491a41ef9def7e743bbaf33c98f7af2398 4554723aa9fc6cf48d123c74f0d654097c200b00 7b8bb225ff21689c93d48c70b967cfd2bb80c2b1 c58ea5219d7803c15ded4c2f04e63577fd1a5420 f27ee616ca50fc6c1fa02beb253a217d77319c79
That range is a few commits all from Kohei Yoshida:
Later it was changed to current mode.
I can confirm the issue with:
Version: 184.108.40.206.alpha0+ / LibreOffice Community
Build ID: e4d377d117874d2dc9039751dc029cb7249bd86c
CPU threads: 16; OS: Linux 5.15; UI render: default; VCL: kf5 (cairo+xcb)
Locale: pt-BR (pt_BR.UTF-8); UI: en-US
Calc: CL threaded
If the cells are empty, replacing the empty values for something won't be registered for future Undo.
The problem does not occur if cells have value.
That's the range, all Kohei:
With source 07bd80e7d94d90be0bc8059e98eade6b3ca2b6c6 it's OK, LO doesn't start with following commits and with source 2f6b33da43a06ff43bda739c41245761ffdf97fa it's already wrong.
Kohei was active few months ago, so let's try with CC @libreoffice.org.