Bug 99672 - Replace All with format in search and empty replace text does not replace.
Summary: Replace All with format in search and empty replace text does not replace.
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
: 112840 118174 (view as bug list)
Depends on:
Blocks: Find-Search Formatting-Text-Diverse
  Show dependency treegraph
 
Reported: 2016-05-04 11:56 UTC by Pieter van Oostrum
Modified: 2023-05-22 17:26 UTC (History)
6 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 Pieter van Oostrum 2016-05-04 11:56:48 UTC
In the Find & Replace Dialog a Replace All with an empty replace text does not function if the search criterium contains a Format.

To reproduce:
1. Open a new Writer document
2. Enter some text and sprinkle the word "test" a couple of times in it.
3. Give (some of) the words "test" a font color, e.g. Red.
4. Open the Replace & Find dialog.
5. In the find text field enter "test" (without the quotes). Leave the replacement text empty.
6. Click Other Options > Format > Font Effects > Font color and select Red
7. Click Replace All.

The dialog answers with "Search key replaced xx times." but in reality the texts are not replaced.

Replace All does work if no format is selected, and/or if the replacement text is not empty.
It also fails if other formats are selected, e.g. Font.

An easy workaround is to click "find All" and then delete the selected text, but the Replace All should also work.
Comment 1 raal 2016-05-05 07:59:17 UTC
I can confirm with Version: 5.2.0.0.alpha0+, 4.5 ; win7
Comment 2 QA Administrators 2017-05-22 13:38:44 UTC Comment hidden (obsolete)
Comment 3 Thomas Lendo 2018-06-14 22:27:17 UTC
*** Bug 118174 has been marked as a duplicate of this bug. ***
Comment 4 QA Administrators 2019-06-15 02:59:28 UTC Comment hidden (obsolete)
Comment 5 David Bolton 2019-06-24 16:10:08 UTC
If the Replace field and formatting is empty, Replace All does nothing (other than highlight the occurrences). 

If the Replace field has no text but has formatting, it swaps out the formatting (but does not delete the text). 

I would expect an empty Replace field to delete all found occurrences (like it does for plain text find and replace). 


Tested using: 

Version: 6.2.4.2 (x64)
Build ID: 2412653d852ce75f65fbfa83fb7e7b669a126d64
CPU threads: 4; OS: Windows 10.0; UI render: default; VCL: win; 
Locale: en-US (en_US); UI-Language: en-US
Calc: threaded
Comment 6 Stéphane Guillou (stragu) 2021-06-28 14:06:56 UTC
Reproduced in:

Version: 7.3.0.0.alpha0+ / LibreOffice Community
Build ID: f446a203fa2897bab8ae7686c948a8bf060675c6
CPU threads: 8; OS: Linux 4.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
TinderBox: Linux-rpm_deb-x86_64@86-TDF, Branch:master, Time: 2021-06-24_15:16:38
Calc: threaded

and:

Version: 7.2.0.0.beta1 / LibreOffice Community
Build ID: c6974f7afec4cd5195617ae48c6ef9aacfe85ddd
CPU threads: 8; OS: Linux 4.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded
Comment 7 Stéphane Guillou (stragu) 2021-06-28 14:10:37 UTC
*** Bug 112840 has been marked as a duplicate of this bug. ***
Comment 8 Stéphane Guillou (stragu) 2021-06-28 14:11:39 UTC
According to duplicate Bug 112840, this is inherited from OOo.