Bug 99038 - Find&Replace with character formatting is broken
Summary: Find&Replace with character formatting is broken
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
5.1.1.3 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Find-Search
  Show dependency treegraph
 
Reported: 2016-04-01 19:26 UTC by Paul
Modified: 2017-02-18 18:57 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:
Regression By:


Attachments
File manifesting several find/replace bugs (185.34 KB, application/vnd.oasis.opendocument.text)
2016-04-10 16:57 UTC, Paul
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Paul 2016-04-01 19:26:39 UTC
I'm trying to do a straightforward Replace operation and running into several problems.

I have an .odt file of about 180kb. It originally was a .doc, and consequently some of the text that was colored is only listed as "User" when I select the text and look under Properties / color. 

Problem 1: This means I cannot do a font color search based on LO color specs. There is no "search for similar formatting" command that I know of. Consequently I must use a workaround. I underlined all text, then intended to search for text with the "Automatic" color set. This would be all text not originally colored. In Replace I specced Without underlining. This would leave me with only the colored text underlined, and I then could do a search for underlined text and change the color.

But several more problems arose.

Problem 2: the Replace All search repeatedly hangs at 50% CPU, for upwards of an hour. I finally have to force LO down. I have a Core2Due @2.4GHz, 4GB RAM. I run LO 5.1.1.3 x64 .deb, and I have dramatically upped its memory allotment in Options.

Problem 3: When speccing the "Automatic" color setting in the Find field, it enters "White" instead. This appears to be a mere labeling error.

Problem 4: When doing a trial Replace (not Replace All), the search finds the underlined text but does not remove the underlining.

So I've got several layers of failure with what I would think is a straightforward function.
Comment 1 Buovjaga 2016-04-10 15:45:34 UTC
Can you attach the file here or does it have confidential information?
I guess we could still test, if you sanitize the contents: https://wiki.documentfoundation.org/QA/Bugzilla/Sanitizing_Files_Before_Submission
(You should of course test that the problems still occur)

Set to NEEDINFO.
Change back to UNCONFIRMED after you have provided the document.
Comment 2 Paul 2016-04-10 16:57:39 UTC
Created attachment 124235 [details]
File manifesting several find/replace bugs

Uploading example file of several find/replace bugs. Easier to follow bug info follows:

LO BUG INFO:
I'm trying to do a straightforward Replace operation and running into several problems.

I have an .odt file of about 180kb. It originally was a .doc, and consequently some of the text (the blue text) that was colored is only listed as "User" when I select the text and look under Properties / color. 

Problem 1: This means I cannot do a font color search based on LO color specs. There is no "search for similar formatting" command that I know of. Consequently I must use a workaround:
1. I underlined all text, then intended to search for text with the "Automatic" color set. This would be all text not originally colored. 
2. In Replace I specced “Without” underlining. This would leave me with only the colored text underlined, and 
3. I then could do a search for underlined text and change the color.

But several more problems arose.

Problem 2: the Replace All search repeatedly hangs at 50% CPU, for upwards of an hour. I finally have to force LO down. I have a Core2Duo @2.4GHz, 4GB RAM. I run LO 5.1.1.3 x64 .deb, and I have dramatically upped LO's memory allotment in Options.

Problem 3: When speccing the "Automatic" color setting in the Find field, it enters "White" instead. This appears to be a mere labeling error however.

Problem 4: When doing a trial Replace (not Replace All), the search finds the underlined text but does not remove the underlining.

So I've got several layers of failure with what should be a straightforward function.
Comment 3 Buovjaga 2016-04-21 10:06:49 UTC
What sort of replacing should I try to get the hang?
Comment 4 Paul 2016-04-21 12:05:33 UTC
See Step 2.
Comment 5 Buovjaga 2017-02-09 13:58:56 UTC
(In reply to Paul from comment #2)
> 1. I underlined all text, then intended to search for text with the
> "Automatic" color set. This would be all text not originally colored. 
> 2. In Replace I specced “Without” underlining. This would leave me with only
> the colored text underlined, and 
> 3. I then could do a search for underlined text and change the color.

Ok, I reproduce the hang in 5.2.

I opened attachment 124235 [details], did not make any changes to it, opened Find & replace, set Find -> Format to be Font color: Automatic.
For replace: Underlining: Without.

Replace all causes hang.

I found a new regression in 5.4: I cannot change the Find Format Font color to Automatic. It offers Chartreuse Green 1 and keeps reverting to it. I have to file a new report for this. I will split problem 2, 3 and 4 from this as well.

Paul: could you describe in detail your desired solution to problem 1?
Comment 6 Paul 2017-02-09 14:20:37 UTC
I suppose the simplest solution might be for LO to pick up the color in its hex or RGB form. I see this is possible natively in the Find/Replace dialog, the problem is that when importing a doc the colors are only listed as "User". So the problem seems to be limited to doc importation.

One workaround might be to pick up the hex number of the color using a color utility (probably have to temporarily enlarge the font to get it), and then maybe LO would find it? Not sure.
Comment 7 Buovjaga 2017-02-13 07:44:40 UTC
Let's involve design team.
Comment 8 Heiko Tietze 2017-02-18 09:47:27 UTC
(In reply to Buovjaga from comment #7)
> Let's involve design team.

I don't get the problem. With 5.3 I enter some text (dt+F3), make a direct formatting to some words and color it blue, open the F&R dialog, select other options, font color, format: font color=blue and run the search. It finds all occurrences. If that doesn't work it's a bug. And of course the whole dialog is a UX mess, but that's another question.

Maybe there is a round-trip issue but that's what I cannot test. NEEDINFO for QA.
Comment 9 Buovjaga 2017-02-18 15:02:08 UTC
Ah, I should have tested after Paul posted his comment 6. The feature he is requesting already exists!

Paul: simply select "Custom color" and input the hex value. In the case of your file the blue is 0033CC as can be spied from the formatting dialog.

Closing this as WFM. I already created the separate reports ealier.
Comment 10 Buovjaga 2017-02-18 18:57:17 UTC
I mistakenly thought I had reported the other problems, but only now got to it.

(In reply to Paul from comment #2)
> Problem 4: When doing a trial Replace (not Replace All), the search finds
> the underlined text but does not remove the underlining.

Paul: as the hanging bug 105882 is now gone, could you try your problem 4 with a build of 5.4? http://dev-builds.libreoffice.org/daily/master/Win-x86@42/current/

I was somewhat confused by this. Maybe exact steps would be good for that. If it still happens, I can report it, but I need to be able to reproduce it.