Bug 128541 - Direct Formatting plus Style Formatting affects results from Find & Replace with Including Styles
Summary: Direct Formatting plus Style Formatting affects results from Find & Replace w...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: low minor
Assignee: Not Assigned
URL: https://help.libreoffice.org/7.1/en-U...
Whiteboard:
Keywords:
Depends on:
Blocks: Find&Replace-Styles
  Show dependency treegraph
 
Reported: 2019-11-01 19:15 UTC by Alex
Modified: 2023-07-27 14:28 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
Demo file with all three combinations of formatting. (10.30 KB, application/vnd.oasis.opendocument.text)
2019-11-02 22:43 UTC, Alex
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alex 2019-11-01 19:15:52 UTC
Description:
In a document with:
- some text formatted with Strong Emphasis Character Style
- some text formatted with Bold (Direct Formatting)
- and some other text with Strong Emphasis Character Style + Bold (Direct Formatting)
when using Find & Replace to search for Bold formatting, all texts with Bold direct formatting are found (ok). However, when checking the Including Style option, only the texts with only one of the formatting are found (Strong Emphasis Character Style OR Bold (Direct Formatting), but not the text with both formatting). The text with both Strong Emphasis Character Style formatting and Bold (Direct Formatting) is not found contrary to what one would expect.

Steps to Reproduce:
1. Edit a text with the three formatting combinations described above: a) Strong Emphasis Character Style, b) Bold (Direct Formatting), c) both Strong Emphasis Character Style + Bold (Direct Formatting)
2. Open Find & Replace and search for bold formatted text, with or without the Including Style option checked

Actual Results:
With Including Style checked, the text with both formatting is not found.

Expected Results:
Checking the Including Style option should find all three combinations of formatting.


Reproducible: Always


User Profile Reset: No



Additional Info:
Comment 1 Oliver Brinzing 2019-11-01 21:00:39 UTC Comment hidden (obsolete)
Comment 2 m_a_riosv 2019-11-01 21:18:34 UTC Comment hidden (obsolete)
Comment 3 Alex 2019-11-02 22:43:27 UTC
Created attachment 155478 [details]
Demo file with all three combinations of formatting.

Thank you for the reply.
Please find here attached a sample file.
Comment 4 QA Administrators 2019-11-03 03:31:30 UTC Comment hidden (obsolete)
Comment 5 Buovjaga 2020-04-26 14:04:52 UTC Comment hidden (obsolete)
Comment 6 m_a_riosv 2020-04-26 14:56:46 UTC Comment hidden (obsolete)
Comment 7 Buovjaga 2020-04-26 15:01:24 UTC
(In reply to m.a.riosv from comment #6)
> (In reply to Buovjaga from comment #5)
> > Already seen in 3.3.0.
> > 
> > Note that you should never mix direct formatting and styles in practice.
> > 
> How to do it?, at least Default it's always there.

Default doesn't seem to have any problems with Find & replace & formatted text.
Comment 8 QA Administrators 2023-01-11 03:23:19 UTC Comment hidden (obsolete)
Comment 9 sdc.blanco 2023-01-11 13:43:24 UTC
repro 

Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 98f0dd5e15733ac7f1d929d06ab230b5f04121d5
CPU threads: 8; OS: Windows 10.0 Build 19044; UI render: Skia/Raster; VCL: win
Locale: da-DK (da_DK); UI: en-US
Calc: CL threaded

Here is another variation on the problem.

1. Make two copies of: "Here is a sentence in all bold"
2. Apply DF bold to both copies, then apply "Strong Emphasis" CS to the word "sentence"  
3. Critical step: In the second sentence, put the cursor immediately after "sentence" and press Ctrl-M (clear direct formating)

4. Find&Replace with "Bold" format, and with and without "Including styles" option

Actual:  If "including styles" is selected, then only beginning of Sentence 1 (up to CS) is found.

Expected:  That CS is found in sentence 1, and part after CS is also found.

Actual:    If "including styles" is not selected, then Sentence 2 is not found.
Expected:  That non-CS parts of sentence 2 are found when not using "including styles".

Using Style Inspector is helpful.  Problems seem to arise both for (a) strings that have both DF character and CS char weights, and (b) DF paragraph and CS char weights.