Bug 129422 - Suppress listing of parent styles in the Find and Replace dialog
Summary: Suppress listing of parent styles in the Find and Replace dialog
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
6.3.3.2 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Find&Replace-Styles
  Show dependency treegraph
 
Reported: 2019-12-16 02:56 UTC by sdc.blanco
Modified: 2022-08-03 15:09 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 sdc.blanco 2019-12-16 02:56:39 UTC
Procedure to demonstrate the bug.

1. Open a Writer document
2. Set style to Heading 1 and insert a string 
3. Find and Replace, check "Paragraph Styles"
4. Use drop down box in Find, select "Heading"
5. "Find Next"

Actual behavior:  "Search key not found"

Expected behavior:  "Finds Heading 1"  (alternatively, Heading does not appear at all)

Additional information:

1.  If another string is added, with its style set as Heading, then it will be found with this procedure (but Heading 1 will not be found).  (It could be useful to be able to search on Heading and find all Headings (regardless of level)

2.  Same effect/bug can be achieved with other hierarchical styles (e.g., "First Line Indent" will also introduce "Text Body" into the drop down box, but will not find anything if searched (unless a Text Body style has actually been applied).

3.  Because "Default Style" is the presumably the top parent, it always shows up in the dropdown box. But it is only found if the Default Style paragraph style is actually applied to a string.  (a little confusing)

tested with 6.3.3.2 and 6.4.0.0.beta1
Comment 1 Dieter 2019-12-16 17:02:34 UTC
I confirm that behaviour with

Version: 6.3.4.2 (x64)
Build-ID: 60da17e045e08f1793c57c00ba83cdfce946d0aa
CPU-Threads: 4; BS: Windows 10.0; UI-Render: Standard; VCL: win; 
Gebietsschema: de-DE (de_DE); UI-Sprache: de-DE
Calc: threaded

List in Find & Replace shows all applied styles (including parent styles)

cc: Design-Team for further input
Comment 2 Heiko Tietze 2019-12-17 11:00:47 UTC
"Heading" is not "Heading 1". You also have Default as another parent in the selection likewise it's the fact for the styles & formatting tab at the sidebar when you filter for "Applied Styles". Thing is, "Heading 1" is derived from "Heading" which is children of "Default", which would be shown when the filter combines with the hierarchical view. Guess it's some effort to suppress the parents in the F&R dialog but keep at the sidebar, though disabled there. What do you think, Mike?
Comment 3 Mike Kaganski 2019-12-17 12:00:23 UTC
(In reply to Heiko Tietze from comment #2)

No idea how to fix this right now; just a quick code pointer to anyone who wants to fix this (I don't think it's an easy hack though): SwStyleSheetIterator::First in sw/source/uibase/app/docstyle.cxx populates the list - see `rDoc.IsUsed(*pColl)` call which checks if the style is used. Currently it returns true for any style that is used, even indirectly. Either the method should take a flag like "bUsedDirectly", or a check should be added later on used styles when only directly used styles are requested.
Comment 4 Heiko Tietze 2019-12-19 12:07:59 UTC
So let's keep the topic alive. The search dropdown should list only those styles that are used in the document and not (unused) parents.

The replace dropdown contains the full list and allows to pick one of the not-yet-used styles, which is the intended workflow.
Comment 5 sdc.blanco 2019-12-19 18:39:34 UTC
(In reply to Heiko Tietze from comment #4)
> The search dropdown should list only those
> styles that are used in the document and not (unused) parents.

Sounds right.
 
Consider to rename top the level “Default Paragraph Style”

One reason is that there are also “Default Style” for Character Styles and Page Styles.  As far as I can tell, there is not a “super” Default Style (that links together the Paragraph, Character, and Page styles together in a single “Default Style).  

Another reason is to highlight/emphasize that all the other paragraph styles are “built” on top of the “Default Paragraph Style”

Maybe this point is also relevant to the "Standard" discussion in bug #128469.

For example, if there was a "Default Paragraph Style" or a "Standard Paragraph Style", then it might make sense for the button in the Paragraph Style Dialog box to be "Default" or "Standard"  (to be consistent with the name of this style).
Comment 6 Heiko Tietze 2019-12-23 10:07:31 UTC
(In reply to sdc.blanco from comment #5)
> Consider to rename top the level “Default Paragraph Style”

Good idea, file bug 129568 about this.
Comment 7 Shivam Kumar Singh 2020-03-01 10:51:45 UTC
(In reply to Mike Kaganski from comment #3)
> Either the method should take a flag like "bUsedDirectly", or a check should
> be added later on used styles when only directly used styles are requested.

Let's implement the "bUsedDirectly" flag. Please help me on how to determine if a style is directly applied or not.
Comment 8 Xisco Faulí 2020-07-22 15:16:36 UTC
Dear Shivam Kumar Singh,
This bug has been in ASSIGNED status for more than 3 months without any
activity. Resetting it to NEW.
Please assign it back to yourself if you're still working on this.
Comment 9 QA Administrators 2022-07-23 03:46:50 UTC Comment hidden (obsolete)
Comment 10 Dieter 2022-07-25 21:08:50 UTC
Still present in

Version: 7.3.5.2 (x64) / LibreOffice Community
Build ID: 184fe81b8c8c30d8b5082578aee2fed2ea847c01
CPU threads: 4; OS: Windows 10.0 Build 19044; UI render: Skia/Raster; VCL: win
Locale: de-DE (de_DE); UI: en-GB
Calc: CL

I'm not sure, but I think list of PS is the same list, that is displayed in navigator if choosing "Applied Styles".
Comment 11 sdc.blanco 2022-08-03 15:05:48 UTC
Also in:

Version: 7.5.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: 41139aa86ecbb4c34e9996eb0f95a194b8eb0771
CPU threads: 8; OS: Windows 10.0 Build 19043; UI render: Skia/Raster; VCL: win
Locale: da-DK (da_DK); UI: en-US
Calc: CL

(In reply to Dieter from comment #10)
> I'm not sure, but I think list of PS is the same list, that is displayed in
> navigator if choosing "Applied Styles".
If you mean "Styles Sidebar", then I have the same impression (i.e., the Applied Styles shown in the Styles Sidebar are the same shown in the Find dialog). Good observation.
Comment 12 Dieter 2022-08-03 15:09:07 UTC
(In reply to sdc.blanco from comment #11)
> If you mean "Styles Sidebar",
Yes.