Bug 156117 - FORMATTING: 'Find and Replace' Style Errors ('Replace All' and 'Replace')
Summary: FORMATTING: 'Find and Replace' Style Errors ('Replace All' and 'Replace')
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
5.4.7.2 release
Hardware: x86-64 (AMD64) Windows (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Find&Replace-Styles
  Show dependency treegraph
 
Reported: 2023-07-01 19:45 UTC by Jeffrey Alan Klute
Modified: 2023-07-15 04:13 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
In the initial bug report I refer to this as *Test.ods (8.21 MB, application/vnd.oasis.opendocument.spreadsheet)
2023-07-01 19:54 UTC, Jeffrey Alan Klute
Details
This is how Find and Replace s/b configured before 'Replace All' (235.35 KB, image/png)
2023-07-01 20:00 UTC, Jeffrey Alan Klute
Details
This shows the Search Results for style 'ToBeDeleted' after 'Replace All' (284 results, there should be zero) (32.81 KB, image/png)
2023-07-01 20:02 UTC, Jeffrey Alan Klute
Details
This shows the Search Results for 'Header1' after 'Replace All' (510 results, there should be 291) (30.69 KB, image/png)
2023-07-01 20:03 UTC, Jeffrey Alan Klute
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jeffrey Alan Klute 2023-07-01 19:45:40 UTC
Description:
In the provided *Test.ods 'Replace All' replaces many cell styles that weren't searched for. On my system the bug happens very frequently, it's repeatable, and on a very stable/clean installation of windows and LibreOffice. The bug involves a major component that would affect many users who manage Style changes using Find and Replace.

Steps to Reproduce:
1. Open '20230701 Find and Replace Style Test.ods'

2. Open the Find and Replace dialog (Ctl+H)
Select 'All sheets'; Select 'Cell Styles' (Other options)
In 'Find:' select style 'ToBeDeleted'; In 'Replace:' select style 'Header1'
Click on 'Find All' and see the Search Results showing "291 results found"
['20230701.1 Screenshot.png' shows how every thing should look at this point]

3. Click on 'Replace All' and see the Search Results showing "291 results found"

4. Click again on 'Find All' and see the Search Results now shows there are yet "284 results found" (there should be zero results after replacing them all)
[see '20230701.2 Screenshot.png']

5. In 'Find:' select style 'Header1'
Click on 'Find All' and see the Search Results now shows there are "510 results found" (there should be 291)
[see '20230701.3 Screenshot.png']

Actual Results:
'Replace All' replaces many cell styles that are not being searched for, and does not replace many cell styles it was searching for that should have been replaced

Expected Results:
'Replace All' should replace 291 cells containing the style 'ToBeDeleted' with the style 'Header1'

After 'Replace All' there should be zero cells with style 'ToBeDeleted' and 291 cells with style 'Header1'


Reproducible: Always


User Profile Reset: Yes

Additional Info:
Version: 7.4.7.2 (x86) / LibreOffice Community
Build ID: 723314e595e8007d3cf785c16538505a1c878ca5
CPU threads: 2; OS: Windows 6.1 Service Pack 1 Build 7601; UI render: Skia/Raster; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: threaded

Final Notes

It can be seen when playing with the (virgin) *Test.ods that a single 'Replace' replaces the next style occurrence found (and not the currently focused cell that should be replaced). In other words, each single replacement is not for the cell found, but the next occurrence of a cell found with the style to be replaced.

The *Test.ods is a copy of a spreadsheet in critical and regular use in my small business: The workaround I had to employ to get past this bug in the test case was to not use 'Replace All' but instead click 'Replace' 291 times. This avoids the corruption of cells not searched for that is introduced if using 'Replace All'.

Thank you for your time in looking into this: There's a lot more work to be done with Styles on this spreadsheet, so I hope we can come up with answers.
Comment 1 Jeffrey Alan Klute 2023-07-01 19:54:26 UTC
Created attachment 188149 [details]
In the initial bug report I refer to this as *Test.ods

*Test.ods contains a style named 'ToBeDeleted' (applied in 291 cells) and another style named 'Header1' (not yet applied to any cells)
Comment 2 Jeffrey Alan Klute 2023-07-01 20:00:13 UTC
Created attachment 188150 [details]
This is how Find and Replace s/b configured before 'Replace All'
Comment 3 Jeffrey Alan Klute 2023-07-01 20:02:48 UTC
Created attachment 188151 [details]
This shows the Search Results for style 'ToBeDeleted' after 'Replace All' (284 results, there should be zero)
Comment 4 Jeffrey Alan Klute 2023-07-01 20:03:46 UTC
Created attachment 188152 [details]
This shows the Search Results for 'Header1' after 'Replace All' (510 results, there should be 291)
Comment 5 m_a_riosv 2023-07-01 22:34:17 UTC
Maybe the same issue as in https://bugs.documentfoundation.org/show_bug.cgi?id=144299
Reproducible
Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: e836e69eb6f2f01a475c5679fb338dda7936643f
CPU threads: 16; OS: Windows 10.0 Build 22621; UI render: Skia/Raster; VCL: win
Locale: es-ES (es_ES); UI: en-US Calc: CL threaded
Comment 6 Jeffrey Alan Klute 2023-07-02 12:16:21 UTC
Confirmed/reproducible on slightly older version.

Version: 7.2.6.2 (x64) / LibreOffice Community
Build ID: b0ec3a565991f7569a5a7f5d24fed7f52653d754
CPU threads: 4; OS: Windows 6.1 Service Pack 1 Build 7601; UI render: Skia/Raster; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: threaded
Comment 7 Jeffrey Alan Klute 2023-07-02 13:30:23 UTC
Confirmed/reproducible on very old version.

Version: 5.4.7.2
Build ID: c838ef25c16710f8838b1faec480ebba495259d0
CPU threads: 6; OS: Windows 5.1; UI render: default; 
Locale: en-US (en_US); Calc: CL