Bug 165354 - DOCX: fix layout of hyphenated text by supporting useWord2013TrackBottomHyphenation = false (i.e. moving only the last word, not the whole hyphenated line)
Summary: DOCX: fix layout of hyphenated text by supporting useWord2013TrackBottomHyphe...
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:25.8.0 inReleaseNotes:25.8
Keywords:
Depends on:
Blocks: DOCX-Paragraph Hyphenation Authors DOCX-compatibilityMode-15
  Show dependency treegraph
 
Reported: 2025-02-20 11:47 UTC by László Németh
Modified: 2025-04-02 07:43 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
test document created in MSO 2016 or later (version 16.0000) (19.53 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2025-02-20 11:58 UTC, László Németh
Details
tdf165354_page.fodt: loext:hyphenation-keep-line test document (29.87 KB, application/vnd.oasis.opendocument.text-flat-xml)
2025-03-04 12:07 UTC, László Németh
Details
tdf165354_spread.fodt: loext:hyphenation-keep-line test document (29.31 KB, application/vnd.oasis.opendocument.text-flat-xml)
2025-03-04 12:10 UTC, László Németh
Details
tdf165354_spread-left-page.fodt: loext:hyphenation-keep-line test document (30.20 KB, application/vnd.oasis.opendocument.text-flat-xml)
2025-03-04 12:15 UTC, László Németh
Details
MoveLineInsteadOfHyphenationAcross.png: screenshot of the associated check box “Move Line” of Text Flow of paragraph formatting (88.11 KB, image/png)
2025-03-04 12:22 UTC, László Németh
Details
Last word of last line is now moved to next page (instead of hyphenation) (976.55 KB, image/png)
2025-03-07 11:49 UTC, Piotr Osada
Details
Fix parameter (working animation) (920.43 KB, image/gif)
2025-03-07 11:51 UTC, Piotr Osada
Details
Fix parameter (animation) (920.43 KB, image/gif)
2025-03-07 11:54 UTC, Piotr Osada
Details
Fix parameter (animation) (920.45 KB, image/gif)
2025-03-07 11:55 UTC, Piotr Osada
Details
'Move Line' parameter behavior (452.66 KB, image/gif)
2025-03-07 12:12 UTC, Piotr Osada
Details
tdf165354_unit_tests.zip: unit tests of the commit “part 4” and “3-page or longer paragraphs” (55.40 KB, application/zip)
2025-03-12 11:40 UTC, László Németh
Details

Note You need to log in before you can comment on or make changes to this bug.
Description László Németh 2025-02-20 11:47:41 UTC
Description:
Only useWord2013TrackBottomHyphenation = true was implemented in Bug 160518 and Bug 132599, but not useWord2013TrackBottomHyphenation = false, when only a single hyphenated word shifted to the next column or page, not the full line.

Steps to Reproduce:
1. Open the attached test document.

Actual Results:
The last line on the first page is hyphenated.

Expected Results:
The last line on the first page is not hyphenated by shifting only the last hyphenated word of the line to the next page.


Reproducible: Always


User Profile Reset: No

Additional Info:
See Microsoft Open Specification about useWord2013TrackBottomHyphenation:

*https://learn.microsoft.com/en-us/openspecs/office_standards/ms-docx/e6cd53b7-89ac-4c64-a6b2-cd1df8b08228
Comment 1 László Németh 2025-02-20 11:58:53 UTC
Created attachment 199341 [details]
test document created in MSO 2016 or later (version 16.0000)
Comment 2 László Németh 2025-02-21 07:56:30 UTC
László Németh committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/3e02ffb76c484a05cdc140d8a10bc3d993fe8320

tdf#i165354 sw offapi DOCX: implement HyphenationKeepLine – part 1

It will be available in 25.8.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 3 Commit Notification 2025-03-03 13:28:19 UTC
László Németh committed a patch related to this issue.
It has been pushed to "master":

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

tdf#165354 sw xmloff: implement HyphenationKeepLine – part 2

It will be available in 25.8.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 4 Commit Notification 2025-03-04 07:50:31 UTC
László Németh committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/698b38a18f5f70fd8d50968bc50951aba7085175

tdf#165354 sw cui: implement HyphenationKeepLine – part 3

It will be available in 25.8.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 5 László Németh 2025-03-04 12:07:51 UTC
Created attachment 199594 [details]
tdf165354_page.fodt: loext:hyphenation-keep-line test document

Last hyphenated word “atmosphere” is moved to the next page.
Comment 6 László Németh 2025-03-04 12:10:45 UTC
Created attachment 199595 [details]
tdf165354_spread.fodt: loext:hyphenation-keep-line test document

Last word of the spread is moved to the next page, because it would be hyphenated, which is forbidden by hyphenation-keep and hyphenation-keep-line.
Comment 7 László Németh 2025-03-04 12:15:22 UTC
Created attachment 199596 [details]
tdf165354_spread-left-page.fodt: loext:hyphenation-keep-line test document

Hyphenation is not forbidden in the last line of the left page, because it is forbidden only on the right pages (hyphenation-keep-type="spread"), and this works with hyphenation-keep-line="true", too (when only the hyphenated word, and not the entire line is moved to the next page, if the hyphenation is forbidden in the last line).
Comment 8 László Németh 2025-03-04 12:22:54 UTC
Created attachment 199597 [details]
MoveLineInsteadOfHyphenationAcross.png: screenshot of the associated check box “Move Line” of Text Flow of paragraph formatting

Enabled only if loext:hyphenation-keep-line="false" (or if MSO compatibility option useWord2013TrackBottomHyphenation="1").
Comment 9 Commit Notification 2025-03-05 23:27:59 UTC
László Németh committed a patch related to this issue.
It has been pushed to "master":

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

tdf#165354 sw: fix frame update (HyphenationKeepLine – part 4)

It will be available in 25.8.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 10 Commit Notification 2025-03-06 20:00:46 UTC
László Németh committed a patch related to this issue.
It has been pushed to "master":

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

tdf#165354 sw HyphenationKeepLine: fix 3-page or longer paragraphs

It will be available in 25.8.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 11 Piotr Osada 2025-03-07 11:49:08 UTC
Created attachment 199678 [details]
Last word of last line is now moved to next page (instead of hyphenation)

Expected Results are now satisfied:
The last line on the first page is not hyphenated by shifting only the last hyphenated word of the line to the next page.

Verified in:
Version: 25.8.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 894563ee0e4032019623a97c313af3d833863b1f
CPU threads: 16; OS: Windows 11 X86_64 (build 26100); UI render: Skia/Vulkan; VCL: win
Locale: pl-PL (pl_PL); UI: en-US
Calc: CL threaded

https://dev-builds.libreoffice.org/daily/master/Win-x86_64@tb77-TDF/2025-03-07_02.42.20/
Comment 12 Piotr Osada 2025-03-07 11:51:26 UTC
Created attachment 199679 [details]
Fix parameter (working animation)

Left:
Version: 24.2.7.2 (X86_64) / LibreOffice Community
Build ID: ee3885777aa7032db5a9b65deec9457448a91162
CPU threads: 16; OS: Windows 10.0 Build 26100; UI render: Skia/Raster; VCL: win
Locale: pl-PL (pl_PL); UI: en-US
Calc: CL threaded


Right:
Version: 25.8.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 894563ee0e4032019623a97c313af3d833863b1f
CPU threads: 16; OS: Windows 11 X86_64 (build 26100); UI render: Skia/Vulkan; VCL: win
Locale: pl-PL (pl_PL); UI: en-US
Calc: CL threaded
Comment 13 Piotr Osada 2025-03-07 11:54:30 UTC
Created attachment 199680 [details]
Fix parameter (animation)
Comment 14 Piotr Osada 2025-03-07 11:55:24 UTC
Created attachment 199681 [details]
Fix parameter (animation)

1000 ms instead of 2000
Comment 15 Piotr Osada 2025-03-07 12:12:30 UTC
Created attachment 199682 [details]
'Move Line' parameter behavior

'Move Line' parameter behavior GIF animation (1000 ms).

In:
Version: 25.8.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 894563ee0e4032019623a97c313af3d833863b1f
CPU threads: 16; OS: Windows 11 X86_64 (build 26100); UI render: Skia/Vulkan; VCL: win
Locale: pl-PL (pl_PL); UI: en-US
Calc: CL threaded
Comment 16 Commit Notification 2025-03-11 12:22:00 UTC
László Németh committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/help/commit/9453c4646b34c22dcf59bc3c9ac8614029dbcad0

tdf#165354 sw: document Text Flow->Move Line (HyphenationKeepLine)
Comment 17 László Németh 2025-03-12 11:40:15 UTC
Created attachment 199750 [details]
tdf165354_unit_tests.zip: unit tests of the commit “part 4” and “3-page or longer paragraphs”

tdf165354_column.fodt
tdf165354_frames_on_right_pages_no_hyphenation.fodt
tdf165354_frames_on_same_page_hyphenation.fodt
tdf165354_frames_on_same_page_no_hyphenation.fodt
tdf165354_frames_on_spread_hyphenation.fodt
tdf165354_long_paragraph_2.fodt
tdf165354_long_paragraph_3.fodt
tdf165354_long_paragraph.fodt
tdf165354_page_in_last_column.fodt
tdf165354_page_in_not_last_column.fodt
tdf165354_page_in_table.fodt
Comment 18 Commit Notification 2025-03-17 16:21:42 UTC
László Németh committed a patch related to this issue.
It has been pushed to "master":

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

tdf#165354 sw HyphenationKeepLine: apply it on the sidebar

It will be available in 25.8.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 19 Commit Notification 2025-04-02 07:43:23 UTC
László Németh committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/7afd5aa47cda6200d259d025163a207b80068622

tdf#165354 cui: gray out Move Line at disabling hyphenation

It will be available in 25.8.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.