Download it now!
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)
(earliest affected) Master
Hardware: All All
: medium normal
Assignee: Not Assigned
: 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: 2019-09-24 20:01 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


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:, 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: (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