Bug 155177 - Writer: Widow/orphan behaviour not reliably predictable
Summary: Writer: Widow/orphan behaviour not reliably predictable
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.5.3.2 release
Hardware: All All
: medium normal
Assignee: Michael Stahl (allotropia)
URL:
Whiteboard: target:24.2.0 target:7.6.2 target:7.5...
Keywords: bibisected, bisected, regression
Depends on:
Blocks: Paragraph
  Show dependency treegraph
 
Reported: 2023-05-07 16:14 UTC by ajlittoz
Modified: 2023-11-02 18:28 UTC (History)
8 users (show)

See Also:
Crash report or crash signature:


Attachments
Document without widow/orphan control (42.08 KB, application/vnd.oasis.opendocument.text)
2023-05-07 16:14 UTC, ajlittoz
Details

Note You need to log in before you can comment on or make changes to this bug.
Description ajlittoz 2023-05-07 16:14:39 UTC
Created attachment 187127 [details]
Document without widow/orphan control

This is a follow-on for https://ask.libreoffice.org/t/disabled-orphan-still-active/91037

Experiments done under
Version: 7.5.3.2 (X86_64)
Build ID: 50(Build:2)
CPU threads: 4; OS: Linux 6.2; UI render: default; VCL: kf5 (cairo+xcb)
Locale: fr-FR (fr_FR.UTF-8); UI: en-US
Calc: threaded

User complains that sometimes blank space is left at bottom of pages though there is "visually" enough room for extra line(s). In addition, text reflow seems to be erratic.

The attached sample file has been carefully tuned so that there is an exact (!) count of 12 pt Liberation Serif lines within the pages. Vertical margins have been adjusted within 0.01 mm.

For maximum text "compacity", widow/orphan control has been disabled. Page 2+ use Text Body where only spacing above and blow differ from Default Paragraph Style. Spacing below has been set to 0.20 cm and remains constant. Spacing above is first set so that blank space appears at bottom of page 2. This ends up at above/below equal to 0.21/0.20 cm.

In the bottom trials, always start from the attached sample without modification.

- Experiment # 1 -
------------------

Decrement spacing above progressively by 0.01 cm and Apply or OK between each decrementation.

Nothing changes until spacing above reaches 0.12 cm, at which time _TWO_ lines, not one, are borrowed from next page to fill the gap.

Now, increment spacing above by 0.01 cm.

0.13 will flush the last line onto next page. This is not symmetrical relative to decrementation!
You need to return to 0.21 cm to revert to initial state.

- Experiment # 2 -
------------------

Starting from the sample, spacing above is decremented to 0.20 cm. Nothing changes on screen, even if Tools>Update>Update all is triggered. Document is saved, closed and reopened. Now there is an extra line at bottom of page (as would be expected)

Other experiments with saving the document at different stages in decrementing spacing above show a different aspect of socument when reopening: the number of lines at bottom of page 2 may be different from what was displayed before saving.

Generally speaking, text layout when opening the document is what is expected by user. But text not being correctly flown when working on styles may cause user to overpatch his styles by giving excessive values to parameters and being confused by the changes aspect when reloading.

Also the hysteresis behaviour is not a good thing as it questions the reliability of text flow.

Will add Mike Kaganski in CC to make him aware of this bug report.
Comment 1 Mike Kaganski 2023-05-08 17:29:42 UTC
Repro exactly as described.
Interesting if this behavior changed at some point.
Comment 2 Mike Kaganski 2023-05-08 17:38:59 UTC
Worked fine in 7.4.0.
Comment 3 Mike Kaganski 2023-05-14 13:02:27 UTC
Regression after commit 8c32cc17ce914188ea6783b0f79e19c5ddbf0b8d (tdf#146500 sw: try to fix some layout loops caused by fly in table cell, 2022-10-14).
Comment 4 kostuj78 2023-07-07 01:35:49 UTC
Before deciding anything further I am just trying to understand how the ticket/bug process and Foundation work, as I am not sure how to interpret certain terminologies. Does the term "Not Assigned" above mean what it states and that no one is actively investigating this particular bug at this time? I am trying every new version as it comes out with no changes in the noted behavior observed as of yet.

And the behavior seemed to continue even after I tried uninstalling the latest and installing an earlier version of Libre that appeared to work just fine previously. So it might be that some part(s) of the application is not being totally removed when uninstalling and reinstalling. Whether related or not, the behavior started around the same time as when Libre temporary files started appearing on my desktop by the ton when trying to work with the application, commonly then staying there the rest of the day. (I did check the path for such files and it is what it is supposed to be according to Libre documentation.)

Some type of virus, conflicting program, or hardware issue with my computer is always possible (Windows 10 Pro), though I am not convinced of that at this time. Any update at all would be appreciated, as I have been unable to finish revising a book project due to these basic issues and really need to get back to that soon one way or another. Thank you very much. I really appreciate it.
Comment 5 isaacaweiss 2023-07-23 19:18:14 UTC
(In reply to kostuj78 from comment #4)
> Before deciding anything further I am just trying to understand how the
> ticket/bug process and Foundation work, as I am not sure how to interpret
> certain terminologies. Does the term "Not Assigned" above mean what it
> states and that no one is actively investigating this particular bug at this
> time? I am trying every new version as it comes out with no changes in the
> noted behavior observed as of yet.
> 
> And the behavior seemed to continue even after I tried uninstalling the
> latest and installing an earlier version of Libre that appeared to work just
> fine previously. So it might be that some part(s) of the application is not
> being totally removed when uninstalling and reinstalling. Whether related or
> not, the behavior started around the same time as when Libre temporary files
> started appearing on my desktop by the ton when trying to work with the
> application, commonly then staying there the rest of the day. (I did check
> the path for such files and it is what it is supposed to be according to
> Libre documentation.)
> 
> Some type of virus, conflicting program, or hardware issue with my computer
> is always possible (Windows 10 Pro), though I am not convinced of that at
> this time. Any update at all would be appreciated, as I have been unable to
> finish revising a book project due to these basic issues and really need to
> get back to that soon one way or another. Thank you very much. I really
> appreciate it.

Yes, "Not Assigned" means that no one has specifically taken responsibility for fixing the bug. It is not caused by a virus, conflicting program, or hardware issue; the same version of LibreOffice has the same problem on everyone else's computer (for example, mine). I, too, am working on a book project, and I reverted to an earlier version of LibreOffice because of this issue. Downloading new versions will not help until this bug is marked as RESOLVED, but downloading an old one will!
Comment 6 Tex2002ans 2023-08-08 07:48:20 UTC
Fantastic to see Mike Kaganski bibisected. Thanks. :)

- - -

There are also 2 more users who have this exact issue:

6 days ago:

- https://www.reddit.com/r/libreoffice/comments/15fdklk/line_spacing_issues_inconsistent_carriage_returns/

2 months ago:

- https://www.reddit.com/r/libreoffice/comments/13feq8d/empty_lines_at_random_pages_on_writer_after/

Both upgraded to 7.4.7 from older versions and saw odd line issues in old documents.

- - -

> Before deciding anything further I am just trying to understand how the ticket/bug process and Foundation work, as I am not sure how to interpret certain terminologies. Does the term "Not Assigned" above mean what it states and that no one is actively investigating this particular bug at this time? I am trying every new version as it comes out with no changes in the noted behavior observed as of yet.

kostuj78, welcome to the LibreOffice Bugzilla. :)

Yes, the technical terms might be a little confusing in the beginning, but it's not so bad once you:

- Learn to ignore the non-developer stuff.
- Focus only on the relevant-to-you info.

A few months ago, I wrote a post here:

- https://www.reddit.com/r/libreoffice/comments/143hd0i/how_can_i_make_the_toolbar_always_show_these/jnkrsn5/

describing what all those mumbo jumbo terms at the top of the Bugzilla is:

You see where it says:

- Status
--- ^ THIS ONE.
- Alias
- Product
- [...]
- URL
- Whiteboard:
--- ^ THIS ONE.
- Keywords

As a normal person, you can pretty much ignore all of them besides:

- Status
- Whiteboard

"Status" tells you if the bug is fixed or not:

- NEW = It's a known bug, but isn't fixed yet.
- RESOLVED FIXED = It's been fixed!

"Whiteboard" tells you exactly which LO version the bugfix got put into.

So, after the bug is fixed, you might see something like this:

- target:7.6.0,7.5.6

That lets you know that:

- 7.6.0 + 7.5.6 will be the exact versions with the fix!

As long as you're beyond those versions, the bug should be completely gone for you. :)

Right now, on this bug, you can see:

- "Whiteboard" is empty.

That means LO doesn't have a fixed version yet! :)

Hopefully that helped you understand this Bugzilla stuff better.
Comment 7 Commit Notification 2023-08-28 11:47:18 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/fe89122c15744afcaccaa6d6628fa0436adf12e1

tdf#155177 sw: fix 2-line bug in WidowsAndOrphans::WouldFit()

It will be available in 24.2.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 8 Commit Notification 2023-08-28 11:49:24 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/8c24bc5baa1f501943bf955e07787d80cb7a5763

(related? tdf#155177) sw: layout: fix another RemoveFollowFlowLine SNAFU

It will be available in 24.2.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 9 Michael Stahl (allotropia) 2023-08-28 11:49:55 UTC
fixed on master
Comment 10 BogdanB 2023-08-28 19:10:21 UTC
Now it's changing to/from another page when beetween 18/19, so, it's symetrical.
Thanks, Michael.

Verified with
Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: e235e4bb7ce79d6738e1e6267c965f71960466a6
CPU threads: 16; OS: Linux 6.2; UI render: default; VCL: gtk3
Locale: ro-RO (ro_RO.UTF-8); UI: en-US
Calc: threaded
Comment 11 Commit Notification 2023-09-12 14:25:35 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "libreoffice-7-6":

https://git.libreoffice.org/core/commit/9e453a7af284cf17cb0debd2ab027f626e6e4a62

(related? tdf#155177) sw: layout: fix another RemoveFollowFlowLine SNAFU

It will be available in 7.6.2.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 12 Commit Notification 2023-09-22 17:47:44 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "libreoffice-7-5":

https://git.libreoffice.org/core/commit/ce1120eecdafa04b03617dcb88eb6027b6b50679

(related? tdf#155177) sw: layout: fix another RemoveFollowFlowLine SNAFU

It will be available in 7.5.7.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 13 Commit Notification 2023-09-26 11:35:22 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "libreoffice-7-6":

https://git.libreoffice.org/core/commit/6efc84525637ce4291d78033651cf21729baf86a

tdf#155177 sw: fix 2-line bug in WidowsAndOrphans::WouldFit()

It will be available in 7.6.3.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 14 Commit Notification 2023-09-26 11:36:26 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "libreoffice-7-5":

https://git.libreoffice.org/core/commit/f49f87f628197bd58e5a5411a77615a677c0ff83

tdf#155177 sw: fix 2-line bug in WidowsAndOrphans::WouldFit()

It will be available in 7.5.8.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 15 yrtnsky 2023-10-27 12:37:13 UTC Comment hidden (obsolete)
Comment 16 Buovjaga 2023-11-02 18:28:50 UTC
(In reply to yrtnsky from comment #15)
> (In reply to Commit Notification from comment #12)
> > Michael Stahl committed a patch related to this issue.
> > It has been pushed to "libreoffice-7-5":
> > 
> > https://git.libreoffice.org/core/commit/
> > ce1120eecdafa04b03617dcb88eb6027b6b50679
> > 
> > (related? tdf#155177) sw: layout: fix another RemoveFollowFlowLine SNAFU
> > 
> > It will be available in 7.5.7.
> > 
> > The patch should be included in the daily builds available at
> > https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
> > information about daily builds can be found at:
> > https://wiki.documentfoundation.org/Testing_Daily_Builds
> > 
> > Affected users are encouraged to test the fix and report feedback.
> 
> 7.5.7.1 still affected

The main fix is only available in 7.5.8, which was just released: https://blog.documentfoundation.org/blog/2023/11/02/libreoffice-7-5-8-community/