Download it now!
Bug 133300 - Please add the ability to search for Page Styles
Summary: Please add the ability to search for Page Styles
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
6.4.2.2 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Find&Replace-Styles
  Show dependency treegraph
 
Reported: 2020-05-23 08:10 UTC by Luke Kendall
Modified: 2020-10-09 22:49 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:


Attachments
PS in F&R attributes (45.15 KB, image/png)
2020-05-25 08:59 UTC, Heiko Tietze
Details
Dummy text (81.16 KB, application/vnd.oasis.opendocument.text)
2020-05-25 12:29 UTC, Heiko Tietze
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Luke Kendall 2020-05-23 08:10:41 UTC
Search for Page Styles does not work.

Although there is a checkbox for Paragraph Styles in the Attributes sub-panel of the Find & Replace dialogue, there is no way to specify the page style you wish to search for.

I would expect the Find drop-down list to be populated with the applied page styles (i.e. those in use) in the document, to allow you to select one.  It doesn't. If you enter the name of a Paragraph style manually, that doesn't work.

Doing any kind of Find, with the Paragraph Style attribute checked, fails.

Please add this feature.  When you are trying to clean up the styles used in a document (especially one that has been converted from Word), you generally have many, many page styles created by the conversion process.

At present the only way to do this is to page through the document to ensure the cursor appears on each page, and wait there an indeterminate period until you guess the page style indicator at the bottom, or the page style selected in the Manage Styles dialogue (if you chose the Page style tab), updates.  For my book, that can take up to about five seconds.  For a 450pp book, it's a slow and disheartening process, and easy to slip up and miss one - in which case you have to start your manual search all over again.

I suppose another approach might be to unzip the XML and look through that for the use of the page style name, and then find some nearby text that's probably on that page, and then move around in the document in Writer to try to find it for sure.

So, please consider this enhancement.

There would also be an obvious follow-on enhancement of allowing the Replace field to be populated with available page styles, and if Replace is clicked, the chosen page style is applied (as far as that's possible).

I only discovered today that usually, you can double-click on a page style in the Manage Styles dialogue, to apply that style to the current page.  Very useful!

(This enhancement submitted following some very helpful discussion in Bug 133258, correctly resolved and not a bug.)
Comment 1 Heiko Tietze 2020-05-25 08:59:39 UTC
Created attachment 161252 [details]
PS in F&R attributes

You can search for a Page Style. Find & Replace dialog > Attributes... > PS. Works for me in 6.3 and 7.0. Please check again
Comment 2 Luke Kendall 2020-05-25 12:17:14 UTC
Just rechecked in 6.4.3.2, and reconfirmed the bug is exactly as I stated.

I also just checked that there's no way to specify what page style to search for. #1

And while testing it, I just went back to double check that last point (that there was no way to specify a page style in the Find), and found it populated with a recent list of text searches.

When I wiped that out and checked that the F&R of PS still didn't work (#2). It didn't.

But when scrolling down into the Attributes to uncheck the Page Style atrribute, it just now caused a crash.  apport is currently gathering the data.

Fortunately, I think I had all my open documents saved.
Comment 3 Heiko Tietze 2020-05-25 12:29:42 UTC
Created attachment 161262 [details]
Dummy text

First page has style "Left page", second after manual break "Right page". Ctrl+H > Attributes... = Page Style > Find = Right page, Replace = Left page => neither Find nor Replace work. So the point is that we actually have the feature but it's not working as expected.
Comment 4 Heiko Tietze 2020-05-25 12:30:30 UTC
Not sure it ever worked before.
Comment 5 Luke Kendall 2020-05-25 12:35:45 UTC
Just noting that I have no idea what is meant by:

"Ctrl+H > Attributes... = Page Style > Find = Right page, Replace = Left page"

Ctrl+H tells me I don';t have Help installed.

I can find no way to specify contents for the Find: (or the Replace:) fields if Page Style box is checked in Attributes.

I mean, I can type random text in those fields, but no text I have invented results in a successful search.
Comment 6 Heiko Tietze 2020-05-25 15:09:09 UTC
(In reply to Luke Kendall from comment #5)
> "Ctrl+H > Attributes... = Page Style > Find = Right page, Replace = Left
> page"

Sorry for being too terse. Ctrl+H is the default shortcut to open the find and replace dialog, different on macOS. Within the dialog, you find a button that is labelled "Attributes..." and when you click on it the checkbox list has an entry "Page Style". Please also look at the attachment from comment 1.
Comment 7 Telesto 2020-05-25 16:50:59 UTC
(In reply to Heiko Tietze from comment #6)
> (In reply to Luke Kendall from comment #5)
> > "Ctrl+H > Attributes... = Page Style > Find = Right page, Replace = Left
> > page"
> 
> Sorry for being too terse. Ctrl+H is the default shortcut to open the find
> and replace dialog, different on macOS. Within the dialog, you find a button
> that is labelled "Attributes..." and when you click on it the checkbox list
> has an entry "Page Style". Please also look at the attachment from comment 1.

Is it 'Attribute -> Page Style'? 
Not CTRL+H & Checkbox Paragraph Styles <- Looks more like it
Comment 8 Telesto 2020-05-25 20:47:57 UTC
@Heiko/Luke
Only wondering..
You can filter the styles in sidebar -> Styles -> at the bottom.. You have an option.. styles in use.. However, it's lacking an option, unused styles.. if it would be possible to do that, you can easily delete all sorts of cruft

Seems far easier compared to search, or did I misread something..
Comment 9 Luke Kendall 2020-05-26 01:11:43 UTC
Sorry, it's Page Style, yes, not Paragraph Style.
I only just noticed I wrote (by mistake) the latter, instead of what I meant to write:

"Although there is a checkbox for [Page] Styles in the Attributes sub-panel of the Find & Replace dialogue,"

Re this: "Only wondering..
You can filter the styles in sidebar -> Styles -> at the bottom.. You have an option.. styles in use.. However, it's lacking an option, unused styles.. if it would be possible to do that, you can easily delete all sorts of cruft

Seems far easier compared to search, or did I misread something.."

I know about that, but it wouldn't be enough, sorry. I know about the Applied Styles, so you could also achieve a similar clean-up result by just looking at the full list and deleting the unused ones: you can see they're unused because the Delete option is not greyed out.

And my enhancement request is to be able to find a Page Style in use that you want to remove.  Finding which page is using it can take a long time.  (I found in fact that sometimes Writer can take closer to 8 seconds to update the panel with the actual Page Style used by it.)
Comment 11 Telesto 2020-05-26 06:41:28 UTC
(In reply to Telesto from comment #10)
> Hmm, so something like this except including page styles:
> https://design.blog.documentfoundation.org/2019/11/05/proposal-to-
> conveniently-highlight-and-inspect-styles-in-libreoffice-writer/

Sounds like something what hypothetically could be placed in the navigator...
Comment 12 Luke Kendall 2020-05-26 15:17:02 UTC
1/
Some notes about the proposal https://design.blog.documentfoundation.org/2019/11/05/proposal-to-conveniently-highlight-and-inspect-styles-in-libreoffice-writer/ (since I can't comment there):

It is perhaps more intuitive to position the objects in the styles inspector so the highest priority properties are listed at the top. I understand that Direct Formatting always overrides others, so it should appear on the top.

If Character Styles take precedence over Paragraph Styles, then likewise they should appear vertically above them in the inspector.

I note the description also notes that in the example, Text Body inherits from Default. I suggest it should be indented so it appears to be 'under' Default. As it stands it appears to be at the same indent level which to me suggests it's an equal level.

It looks like you're saving UI space might by only listing properties which override a higher level property.  Nice.

I like the idea of showing properties greyed out when a higher priority 'style influencer' has overridden it.

2/
Should the ability to add Find (and Replace?) Page Styles be added to the proposed Style Inspector and/or Styles Highlighter?

My opinion is that because it's a search (and replace?) operation, it would be natural to expect it to be accessed by the F&R panel.  Although it does feel inconsistent that Paragraph Styles gets its own checkbox on the main F&R panel but the only other Style (the Page Style) is 'hidden' under the Attributes... button.

3/
Does the Styles Inspector (or Highlighter) proposal cover Outline & Numbering styles?

That's an area that seems a bit confusing on the UI side at present. Some parts of the Outline & Numbering style can be accessed from the "Outline & Numbering" tab of the Format Paragraph panel.  Other parts can only be accessed via the Numbering, Outline, and Customize tabs of the Bullets and Numbering panel.

It's also confusing to me that if you're defining a new Paragraph Style and you want to define all the numbering style properties, you can't do it from the Format Paragraph panel alone.  I think you ned to define as much as you can there and then maybe select an example paragraph in that new style and open the Bullets and Numbering panel?

4/
An oddity I stumbled over yesterday:
Previously you could define a font colour for a defined Character style, which you can specify for a numbering style. I also discovered yesterday that apparently that colour is now lower priority than the colour of the font you define in the Paragraph Style.
I discovered this when I copied the body of one file into another, and the chapter titles (I had defined as HeaderChar, Georgia, blue) appeared as Georgia, black. To get them to appear blue I had to set the colour in the Font Effect for the chapter title paragraph style.

Actually, this seems to contradict the discussion on styles in that URL, which says Character Style has higher precedence. So maybe that's a new bug?
Comment 13 Heiko Tietze 2020-05-26 16:12:43 UTC
(In reply to Luke Kendall from comment #12)
> Some notes about the proposal ... since I can't comment there
Should be possible, comments are open

> ...listed at the top. 
We discussed this and you are not alone with this opinion. Not mine though.

> ...indented so it appears to be 'under'
You can derive quite far and this indentation fails soon.

> Should the ability to add Find (and Replace?) Page Styles be added to the
> proposed Style Inspector and/or Styles Highlighter?
The deck is just a feedback for the formatting at the cursor. F&R is still done with the dialog - and maybe at a dedicated deck.
 
> Does the Styles Inspector (or Highlighter) proposal cover Outline &
> Numbering styles?
It should, somehow. As these styles are not in the same hierarchy it might be somewhat tricky and I would do simple things first but correctly.

> An oddity I stumbled over yesterday:
Too complicated at the moment and way off-topic.
Comment 14 Mike Kaganski 2020-05-26 16:55:51 UTC
(In reply to Heiko Tietze from comment #3)
> First page has style "Left page", second after manual break "Right page".
> Ctrl+H > Attributes... = Page Style > Find = Right page, Replace = Left page
> => neither Find nor Replace work. So the point is that we actually have the
> feature but it's not working as expected.

This is misconception.

Searching for attributes is not meant to work like you imagined: setting a checkmark to an attribute, then put the wanted attribute values into Find/Replace boxes. That would, e.g., be meaningless if you check several attributes... The feature allows searching for *text* defined in the Find box, which has the attributes selected that simply differ from default. See help [1] for details.

A different thing is that actually selecting "Page style" attribute doesn't seem to work anyway.

Note also that page style is a setting of a paragraph (style), so searching for "page style" would only make sense when searching for paragraphs ...

[1] https://help.libreoffice.org/6.4/en-US/text/shared/guide/find_attributes.html
Comment 15 Heiko Tietze 2020-05-27 16:00:01 UTC
(In reply to Mike Kaganski from comment #14)
> The feature allows searching for *text* defined in the Find
> box, which has the attributes selected that simply differ from default.

RegEx with * in the text input and page style checked... sounds weird too. Other ideas?
Comment 16 Luke Kendall 2020-05-27 16:44:14 UTC
"Searching for attributes is not meant to work like you imagined: setting a checkmark to an attribute, then put the wanted attribute values into Find/Replace boxes. That would, e.g., be meaningless if you check several attributes... The feature allows searching for *text* defined in the Find box, which has the attributes selected that simply differ from default. See help [1] for details."

Interesting. To me that indicates the Page Style should never have been included in the Attributes list.  I don't think your view of the F&R panel matches how it works when searching for Paragraph Styles, which is a valuable and intuitive feature of Writer.

"A different thing is that actually selecting "Page style" attribute doesn't seem to work anyway."

Agreed.

My request is that a user should be able to search to find a page style, just as they can currently search for a Paragraph Style.

"Note also that page style is a setting of a paragraph (style), so searching for "page style" would only make sense when searching for paragraphs ..."

I don't think I understand the above statement, because it makes no sense to me. As far as I know, a Page Style applies to a page, not to a paragraph.  If someone did think that way though it could explain why someone included it in the Attributes... panel.  The statement implies that each paragraph in a page could have a different Page Style, which seems to me to lead to all sorts of confusion and complexity.

The need for a search for Page Style is quite high because when Writer loads a .docx file, it generates vast numbers of page styles with different names even though most of them contain the same settings.
Comment 17 Luke Kendall 2020-05-27 16:48:26 UTC
"RegEx with * in the text input and page style checked... sounds weird too. Other ideas?"

Yes.

I think the idea I outlined in my initial request is both natural, easy to use, and exactly matches what is currently done for finding Paragraph Styles:

I would expect the Find drop-down list to be populated with the applied page styles (i.e. those in use) in the document, to allow you to select one.

There would also be an obvious follow-on enhancement of allowing the Replace field to be populated with available page styles, and if Replace is clicked, the chosen page style is applied (as far as that's possible).
Comment 18 Mike Kaganski 2020-05-27 17:51:16 UTC
(In reply to Luke Kendall from comment #16)
>> The feature allows searching for *text* defined in the Find
>> box, which has the attributes selected that simply differ from default. See
>> help [1] for details."
> 
> ...  I don't think your view of the F&R panel
> matches how it works when searching for Paragraph Styles, which is a
> valuable and intuitive feature of Writer.

>> "Note also that page style is a setting of a paragraph (style), so searching
>> for "page style" would only make sense when searching for paragraphs ..."
> 
> I don't think I understand the above statement, because it makes no sense to
> me. As far as I know, a Page Style applies to a page, not to a paragraph. 
> If someone did think that way though it could explain why someone included
> it in the Attributes... panel.  The statement implies that each paragraph in
> a page could have a different Page Style, which seems to me to lead to all
> sorts of confusion and complexity.

You might need to study how styles work in Writer. "Page" is not something independent there; only content (text and the like) it first-class citizens, and they define everything. Text divides to paragraphs, which have paragraph style and DF; paragraphs consists of spans having character style and DF. Paragraphs have a special property "insert break before with page style". It's paragraph where you define which page style to use to put the content starting from this paragraph. You can't have "each paragraph in a page to have a different Page Style", because every paragraph having a different page style starts a new page.

Anyway, that's offtopic (and you might like to read mode in documentation). What's important is - since page style is property of a paragraph, then how to organize useful search for it. Searching for *text string* is not good, because that string could well be already on another page style (in case of page style sequence defined on Organizer)...
Comment 19 Mike Kaganski 2020-05-27 17:55:43 UTC
IMO, actually extending the "Paragraph Style" checkbox to be a "style "checkbox with a drop-down with "Paragraph/Character/List/Page/..." selection really makes sense. Just documenting that with "search for Page style" is meant searching for paragraphs defining usage of those styles...
Comment 20 Luke Kendall 2020-05-28 04:08:24 UTC
Thanks, that explains a lot. (Makes as much sense as tying a paragraph style to a character, and saying a change of paragraph style induces a new paragraph. But it explains a lot.)

Maybe I should look for a new word processing package. I have about 40 years experience in typesetting and layout and word processing (both using a vast range, and designing & implementing), but I know my opinion will not be appreciated by the LO developers, so...
Comment 21 Heiko Tietze 2020-05-28 10:27:48 UTC
The whole dialog is overloaded, IMHO. If we separate search for styles from text, the dialog becomes more clear and less buggy (PS checked leaves diacritic enabled, for example).

I imagine two tabs, one with "Text" the other with "Styles". On this tab we show radio buttons for PS, CS, FS, PgS, LS and TS and fill the find/replace dropdowns respectively. I believe the internal need to bind a PgS on a PS is not so interesting for users.
Comment 22 Luke Kendall 2020-05-28 10:56:44 UTC
Heiko's suggestion (Comment 21) sounds clear and good to me.