Bug 135783 - cannot change page style
Summary: cannot change page style
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Documentation (show other bugs)
Version:
(earliest affected)
7.0.0.2 rc
Hardware: All All
: medium normal
Assignee: sdc.blanco
URL:
Whiteboard: target:7.2.0
Keywords:
Depends on:
Blocks:
 
Reported: 2020-08-15 17:23 UTC by TorrAB
Modified: 2021-03-25 09:20 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
file with 2 pages (17.10 KB, application/vnd.oasis.opendocument.text)
2020-08-15 17:24 UTC, TorrAB
Details
file with 2 pages (17.10 KB, application/vnd.oasis.opendocument.text)
2020-08-20 19:45 UTC, TorrAB
Details
Screenshot of proposed help update (30.23 KB, image/png)
2021-03-11 12:32 UTC, sdc.blanco
Details
new version of "note" that addresses issue of this bug report (11.98 KB, image/png)
2021-03-11 14:06 UTC, sdc.blanco
Details

Note You need to log in before you can comment on or make changes to this bug.
Description TorrAB 2020-08-15 17:23:06 UTC
Description:
	In pageB.odt, last page has Default style, with header.
	Open the Styles panel, double-click page style Chapitre, which is supposed to hide the header— it does not.
	Go up one page, and come back to last page: style is back to Default! It seems the style was never changed to Chapitre. Why?


Steps to Reproduce:
1.	In pageB.odt, last page has Default style, with header.
2.	Open the Styles panel, double-click page style Chapitre, which is supposed to hide the header— it does not.
3.	Go up one page, and come back to last page: style is back to Default! It seems the style was never changed to Chapitre.

Actual Results:
double-clicking page style Chapitre does not change the style

Expected Results:
double-clicking page style Chapitre should change the style, remove the header.


Reproducible: Always


User Profile Reset: No



Additional Info:
none
Comment 1 TorrAB 2020-08-15 17:24:46 UTC
Created attachment 164329 [details]
file with 2 pages
Comment 2 BogdanB 2020-08-15 17:50:30 UTC
Go to Chapitre Style - right click - Modify - In the Organizer TAB change Next Style to Chapitre.

Problem solved.

LibreOffice have done what you have told it to do.
Comment 3 TorrAB 2020-08-20 19:45:08 UTC
Created attachment 164508 [details]
file with 2 pages
Comment 4 TorrAB 2020-08-20 19:49:46 UTC
(In reply to BogdanB from comment #2)
> Go to Chapitre Style - right click - Modify - In the Organizer TAB change
> Next Style to Chapitre.
> 
> Problem solved.
	 ‘Problem solved’? Not really. That's only a work-around. User should not be stuck with the NextStyle; he|she should be able to override it without changing the style definition.
	 Example with parag style: In pg1, put cursor past 1st line, which is a Heading1. Hit Enter, get new line Heading2 (which is the NextStyle of Heading1).If you don't like it, double-click another style in the page styles list, such as Heading3 — and get it, without changing the NextStyle of Heading1.
Comment 5 BogdanB 2020-08-20 20:02:19 UTC
You can change that after Heading 1 to come Body text or any text you like. Everything is very easy to program in order to make your life easy.

Very easy to use: https://www.youtube.com/watch?v=Zi3LIz8TgHY&t=114s
Comment 6 TorrAB 2020-08-21 00:42:07 UTC
(In reply to BogdanB from comment #5)
> You can change that after Heading 1 to come Body text or any text you like.
> Everything is very easy to program in order to make your life easy.
> 
> Very easy to use: https://www.youtube.com/watch?v=Zi3LIz8TgHY&t=114s

That's right: my life is easy with parag styles; why should it be more difficult with page styles?
Comment 7 Timur 2021-03-09 13:13:14 UTC
Actual issue is : can not change inherited Next style to the predecessor style. 
Meaning that if Style 1 is 1st page and in it's definition is that it's Next style is Style 2,one cannot change page 2 style manually via click to be Style 1.

Unlike manual page breaks, with Next style is is "With page style"  not used in Insert break of Paragraph -  Text flow. 

I reproduce but not sure if this is a bug.
Let's convert to Documentation to be explained in help.
Comment 8 sdc.blanco 2021-03-09 13:19:17 UTC
(In reply to Timur from comment #7)
> Actual issue is : can not change inherited Next style to the predecessor
> style.
See "Inherit From"
https://help.libreoffice.org/7.2/en-US/text/shared/01/05040100.html?&DbPAR=WRITER
Comment 9 sdc.blanco 2021-03-09 13:23:09 UTC
(In reply to sdc.blanco from comment #8)
 "Inherit From" --> "Next Style"
If changes are needed, please make a concrete suggestion.
Comment 10 Timur 2021-03-09 14:48:06 UTC
Not sure but maybe at the end of Next Style:
"Next style doesn't make a break in page style, so you can not change applied next style to the predecessor style. Changing style via click will change styles from predecessor till page break. "
Comment 11 sdc.blanco 2021-03-09 17:47:51 UTC
(In reply to Timur from comment #7)
> I reproduce but not sure if this is a bug.
I suspect it is a bug, or a problem with the template for Chapitre.

First.  About help.

https://help.libreoffice.org/7.2/en-US/text/swriter/guide/pagestyles.html

As expressed there, it should be possible to double-click a page style and have it applied to the page. In the attachment, it is possible to do this with other page styles. 

> Expected Results:
> double-clicking page style Chapitre should change the style, remove the
> header.
I agree that double-clicking should change the style.  And do not understand why it does not work in this case.  But I do notice that the printer setting is left and right and that header setting has something about same content on both pages.  This may have something to do with what is going on in this case.

Meanwhile, click on any other page style on page 2 (e.g., Footnote).  Then it gets applied to both pages.  Afterwards, on p. 2, click on Chapitre, then it goes back to the original configuration, consistent with the speculation in the previous paragraph that it has to do with printer and header settings. iow there is something special about the configuration of Chapitre in pageB.odt  

(I have also noted -- by loading the Page Styles into a new document that applying Chapitre makes the page to be page 0.)

> Let's convert to Documentation to be explained in help.
Putting this back to Writer.  The issue is not about double-clicking to apply page styles.  I do not know enough about left/right pages and header to know what to expect here.  (maybe there is something in the help pages that is relevant).  For example, this page might give TorrAB enough insight to be able to do what is wanted.

https://help.libreoffice.org/7.2/en-US/text/swriter/guide/even_odd_sdw.html

Of course put it back to Documentation if it is possible to identify a specific information that should be added a specific place.
Comment 12 Timur 2021-03-09 19:04:10 UTC
"As expressed there, it should be possible to double-click a page style and have it applied to the page. In the attachment, it is possible to do this with other page styles." 
All comment 11 like it's written not taking comment 10.

I explained why: you cannot change Default to Chapitre because Chapitre is already precedent style and there is no page break.
 It's easy to recreate sample with any style. So nothing special or unexpected here.
Comment 13 Timur 2021-03-10 05:43:03 UTC
We may explain like this : change style on click, even on 2nd page, really does what it's told, applies Chapitre.. but by style definition both pages must be considered and so Chapitre is for 1st page and Default for 2nd. I wrote key point : there's no page break for next style, so both pages must be changed, per style definition. 
so it remains the same. Apply style click cannot change style. No bug here.
Comment 14 sdc.blanco 2021-03-10 12:47:45 UTC
(In reply to TorrAB from comment #4)
> User should not be stuck with the NextStyle; he|she should be able to override 
> it without changing the style definition.
Using the test file attached here.

1. place cursor on dotted line between page 1 and page 2, 
2. Right click,  choose "Edit page break".
3. (in the dialog box that is opened), in Breaks section,
   select checkbox "With Page Style"
4. Set value of "With Page Style" to Chapitre.

The style definition is not changed, but you have made an override.  Do you agree?
Comment 15 sdc.blanco 2021-03-10 13:18:13 UTC
@timur.   Agree behavior is as expected, according to current design. No bug.

About help page: I have not been so familiar with Page Styles (as documented in comment 11).  

Now I will try again.

1.  See bottom of:

https://help.libreoffice.org/7.2/en-US/text/swriter/guide/pageorientation.html

I believe this describes/documents what is happening in this particular case.

2. Perhaps a <note> should be added after "To Apply a Page Style" in:

https://help.libreoffice.org/7.2/en-US/text/swriter/guide/pagestyles.html

that says something like:

    To continue using the same page style on an immediately following page,
    when the Page style uses a different "Next style": Place the cursor 
    between the pages, right click, and choose "Edit Page Break".  Select the
    "With page style" option and enter the page style to be applied. See 
    <link>Manually Defined Range of a Page style.</link>.

(where the link would go to the "The Scope of Page Style" section of the page mentioned in nr. 1.)

@TorrAb  Was curious to know if you tried searching in help pages, and if so, where?  Do you think the proposal here might help -- at least in the sense of pointing a person to the right place for trying to create a solution.
Comment 16 sdc.blanco 2021-03-10 13:31:32 UTC
Even better - and more general.
Add the following heading and procedure after "To Apply a Page Style"
in: https://help.libreoffice.org/7.2/en-US/text/swriter/guide/pagestyles.html

------------------------------------------

To Override a Page Style with a "Next style"

 1. Place cursor between the pages.
 2. Right click and choose "Edit Page Break".  
 3. Select the "With page style" checkbox.
 4. Enter the page style to be applied. 

See <link>Manually Defined Range of a Page style.</link>.

-----------------------------------------

Comments? Suggestions?
Comment 17 Timur 2021-03-11 11:05:36 UTC
As for "To Apply a Page Style", I'd add a Note after "Page Style can be also applied via Status Bar" with link to Status bar help that really explains that (but one who's looking for help how to change page style will look here and will probably not know about status bar).

As for "To Override a Page Style with a "Next style"" it's OK, and I'd also add some text here (after this heading or after all) to give instruction on situation from this bug, similar to idea from comment 15:
"When the Page style uses a different "Next style", later return from Next Style to that Page style is possible only with override, not with applying that same style, because it's already applied".
Comment 18 sdc.blanco 2021-03-11 12:32:54 UTC
Created attachment 170410 [details]
Screenshot of proposed help update

Attached is a screenshot of the proposed patch to the help page - taking account of the requests in comment 17. 

"blue" font indicates a "link" 

In the case of "Status bar" the link goes to:
https://help.libreoffice.org/7.2/en-US/text/shared/01/03060000.html
which explains about "View - Status Bar" (and that page has a link with an Overview about the Status Bar).  

The instructions on the help page proposed here includes the same information found on the Status bar page about page style, so it is better to have a link that explains how to turn on the Status bar.

The "note" attempts to address the problem of this bug report. Help pages try to explain how to accomplish what you want to do (and do not usually explain why something did not work like you expected). It was challenging to write a clear explanation, but hope this note will be meaningful to someone who knows that they have created a style with a different "Next style".  (All the built-in page styles use the same page style for "next style" as the page style itself.)

Also added a bookmark about overriding page styles for the index.

Ready to go, if no further comments: https://gerrit.libreoffice.org/c/help/+/112292/
Comment 19 sdc.blanco 2021-03-11 14:06:11 UTC
Created attachment 170411 [details]
new version of "note" that addresses issue of this bug report

Further analysis reveals that the built-in page styles "First Page", "Left" and "Right" have different "Next styles".  Can we speculate that some have used "First Page" and then could not understand why it could not be applied on the second document page?  

This has inspired a revision of the "note" about this issue, because it is possible to use a builtin style ("First Page") as an example. See attached. 

The usual aim is to keep notes short. I could not see how to make this one shorter, but I think it does a pretty good job of addressing the issue that arose here.  I hope you agree.
Comment 20 Commit Notification 2021-03-15 14:35:46 UTC
Seth Chaiklin committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/help/commit/bbcbc7ca09d2301e8fbcbaed37588959ba4e6b68

tdf#135783 improvements about applying page styles
Comment 21 BogdanB 2021-03-25 08:07:52 UTC
Seth Chaiklin, if this patch solved this bug, please assign this bug to you, then mark the bug as Resolved.
Comment 22 Timur 2021-03-25 08:50:09 UTC
I think this is clear now.