Bug 146279 - white space in Libre Writer after formating heading 2, 3 4 etc.
Summary: white space in Libre Writer after formating heading 2, 3 4 etc.
Status: RESOLVED NOTABUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.4.0.0 alpha0+
Hardware: All Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-12-17 11:25 UTC by JP
Modified: 2022-01-03 11:20 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
legal document - with numbering & headings (22.36 KB, application/vnd.oasis.opendocument.text)
2021-12-17 11:26 UTC, JP
Details
Example file (17.49 KB, application/vnd.oasis.opendocument.text)
2021-12-17 19:37 UTC, Telesto
Details

Note You need to log in before you can comment on or make changes to this bug.
Description JP 2021-12-17 11:25:18 UTC
Description:
I type a very lengthy document. The spacing was perfect and the heading were perfect with Bullets & Numbering, but after saving a reopening the document for some unknown reason at page 4 suddenly a huge amount of surplus white space was added and the next heading 4 was started on a new page and I had lost about 3/4 of the previous page.

Steps to Reproduce:
1.Type a long document, correct the format with numbering and several headings.
2.When getting down to Heading level 4, and after saving a document and re-opening the additional unexplain white space exists. It also does it randomly on different pages.
3.

Actual Results:
1.Type a long document, correct the format with numbering and several headings.
2.When getting down to Heading level 4, and after saving a document and re-opening the additional unexplain white space exists. It also does it randomly on different pages.

Expected Results:
The white space should not be created for unknown reason


Reproducible: Always


User Profile Reset: No



Additional Info:
[Information automatically included from LibreOffice]
Locale: en-US
Module: TextDocument
[Information guessed from browser]
OS: Linux (All)
OS is 64bit: yes
Comment 1 JP 2021-12-17 11:26:17 UTC
Created attachment 176977 [details]
legal document - with numbering & headings
Comment 2 JP 2021-12-17 11:29:09 UTC
See page 6 of the attached document
Comment 3 Telesto 2021-12-17 19:21:11 UTC
(In reply to JP from comment #2)
> See page 6 of the attached document

Took a while to figure it out... 
1. Sidebar -> Styles tab -> Right click Heading 3 -> Modify
2. Text flow tab -> Uncheck keep with next paragraph
Comment 4 Telesto 2021-12-17 19:31:18 UTC
@Heiko
Me confused why "Keep with next paragraph" matters here. Help says: "Keeps the current paragraph and the following paragraph together when a break or column break is inserted."

This doesn't really add up with the behaviour seen here, in my perception. But well this bit of aregular use of headings.. so no clue about the bigger purpose

Also seen in
LibreOffice 3.5.0rc3 
Build ID: 7e68ba2-a744ebf-1f241b7-c506db1-7d53735
Comment 5 Telesto 2021-12-17 19:37:37 UTC
Created attachment 176982 [details]
Example file

Simplified
1. Open the attached file
2. Press Enter before e-mail.. See 3 headings move the next page
3. Press Undo
4. Press Enter after first heading (ending with 'town?')
5. A new paragraph is created with text body, but also moving both other heading to next page
Comment 6 Heiko Tietze 2021-12-20 10:44:18 UTC
The help says: "Keeps the current paragraph and the following paragraph together when a break or column break is inserted." and this is exactly what happens.

I think formatting a document with only headings is the mistake here. Typically, headings are followed by some text- and you never want the document to break before the text. If every paragraph should be kept together with the following you don't give the layouting procedure a chance to break gracefully 

But I see no way to number paragraphs with a text style following the chapter numbering. Mike, do you?

The actual solution is clearly to uncheck the keep together flag for H3 in this case. => NAB
Comment 7 Mike Kaganski 2021-12-20 15:47:30 UTC
(In reply to Telesto from comment #5)
> 1. Open the attached file
> 2. Press Enter before e-mail.. See 3 headings move the next page

This is IMO unexpected, because in *this specific case*, there's no next paragraph after the last heading -> hence, IMO last paragraph's "keep with next" should not fire, and thus last paragraph should split according to orphan/widow control. So in my opinion, the correct operation would be: the whole two headings, and *most part* of the third heading, should stay on the same page, and only last two lines of the last heading should go to the next page.

However, the current behavior is since ~forever (at lease inherited from OOo), and thus is unlikely to change. Then another reasonable option would be to set this in stone, *maybe* put to standard (if we put such things to standard), and *disable* both "do not split" (which must show checked) and "orphan/widow control" when keep with next is active.

> 3. Press Undo
> 4. Press Enter after first heading (ending with 'town?')
> 5. A new paragraph is created with text body, but also moving both other
> heading to next page

Perfectly fine, creation of the new text body paragraph being defined by the heading style's "next style" setting.

(In reply to JP from comment #0)
> The spacing was perfect and the heading were
> perfect with Bullets & Numbering, but after saving a reopening the document
> for some unknown reason at page 4 suddenly a huge amount of surplus white
> space was added

Every such issue is a bug, when layout differs in a native file format before and after save/reload. However it needs reproducible steps to repro to be able to work on this.

(In reply to Heiko Tietze from comment #6)
> But I see no way to number paragraphs with a text style following the
> chapter numbering. Mike, do you?

IMO use of heading in such case id OK, but requires fine-tuning of the lower-rank heading paragraphs. Other options could be using number range fields (which one would need to insert manually to the beginning of paragraphs - e.g. copying and pasting previous such fields).

> The actual solution is clearly to uncheck the keep together flag for H3 in
> this case. => NAB

I agree; please decide yourself if you want to track the problem with "keep with next" conflicting with "do not split"/"widow/orphan control" mentioned above here or in a different issue.