Bug 151213

Summary: Undo doesn't work after Find and replace with replacing blank cells
Product: LibreOffice Reporter: Timur <timur>
Component: CalcAssignee: Not Assigned <libreoffice-bugs>
Status: NEW ---    
Severity: normal CC: kohei, rafael.palma.lima
Priority: medium Keywords: bibisected, regression
Version: 4.1.6.2 release   
Hardware: All   
OS: All   
See Also: https://bugs.documentfoundation.org/show_bug.cgi?id=104933
https://bugs.documentfoundation.org/show_bug.cgi?id=114038
Whiteboard:
Crash report or crash signature: Regression By: Kohei Yoshida
Bug Depends on:    
Bug Blocks: 102847, 105948    

Description Timur 2022-09-28 12:02:15 UTC
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

Actual Results:  
Undo removes text you wrote in step 1. 

Expected Results:
Undo should remove what's replaced.
Comment 2 Rafael Lima 2022-09-28 17:04:48 UTC
I can confirm the issue with:

Version: 7.5.0.0.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.
Comment 3 Timur 2022-09-29 08:11:56 UTC
That's the range, all Kohei:
https://cgit.freedesktop.org/libreoffice/core/log/?qt=range&q=14afe7b9b057e5bbd68d41573884c8a85761712d..2f6b33da43a06ff43bda739c41245761ffdf97fa

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.