Bug 164095 - FILEOPEN DOCX Spacing before paragraph is ignored after section break
Summary: FILEOPEN DOCX Spacing before paragraph is ignored after section break
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
24.2.4.2 release
Hardware: All All
: medium normal
Assignee: Miklos Vajna
URL: https://vmiklos.hu/blog/sw-ignore-mar...
Whiteboard: target:25.8.0 target:25.2.0.0.beta2 t...
Keywords: bibisected, bisected, regression
Depends on:
Blocks: DOCX-Page
  Show dependency treegraph
 
Reported: 2024-11-29 17:00 UTC by Gabor Kelemen (allotropia)
Modified: 2025-01-21 15:51 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
Example file from Word 2021 (16.83 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2024-11-29 17:00 UTC, Gabor Kelemen (allotropia)
Details
The example file in Word 2021 and Writer master (177.63 KB, image/png)
2024-11-29 17:01 UTC, Gabor Kelemen (allotropia)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Gabor Kelemen (allotropia) 2024-11-29 17:00:49 UTC
Created attachment 197863 [details]
Example file from Word 2021

Attached document has two different page breaks: page break and section break.
The Heading 1 after these has 18 pt spacing before set.
In Word 2021 this spacing is ignored after a page break, but not after the section break.
In Writer it started to be ignored in both cases.

1. Open attached file
2. Go to the second and third pages
-> the Heading 1 paragraph should have the spacing before applied at the top of the third page, but it is missing.

Version: 25.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 83910246044c1e05a3b50e25d21ac6a31566cc38
CPU threads: 6; OS: Windows 10 X86_64 (10.0 build 19045); UI render: Skia/Raster; VCL: win
Locale: en-GB (en_GB); UI: en-US
Calc: threaded

Seems to have started in 24.2.4 with:

https://git.libreoffice.org/core/+/abd90828cf101581a07b9d1c371a8c3156521e9f%5E%21

author	Miklos Vajna <vmiklos@collabora.com>	Tue May 07 08:13:37 2024 +0200
committer	Michael Stahl <michael.stahl@allotropia.de>	Tue May 14 11:15:21 2024 +0200
tree 0c32f30b545248604ac19bdf09dc7a8c1433b4db
parent 95fdda2f027f2bcdd135b3f55c549d6f2339e086 [diff]

tdf#160952 sw: ignore top margin of para on non-first pages with newer DOCX

Adding CC to: Miklos Vajna
Comment 1 Gabor Kelemen (allotropia) 2024-11-29 17:01:15 UTC
Created attachment 197864 [details]
The example file in Word 2021 and Writer master
Comment 2 Marina Latini (SUSE) 2024-11-30 02:09:35 UTC
Can repro on:

Version: 25.2.0.0.alpha1+ (X86_64) / LibreOffice Community
Build ID: ab60c81f77f45315ba3cfc7cae6c1d9144588663
CPU threads: 8; OS: Linux 5.14; UI render: default; VCL: kf5 (cairo+xcb)
Locale: en-GB (en_GB.UTF-8); UI: en-US
Calc: threaded
Comment 3 Miklos Vajna 2024-12-02 15:23:53 UTC
Thanks, interesting. Do you understand the Word behavior here? Why is the margin ignored in case  of the above commit's bugdoc, but not here?

Is that because top margins should be ignored after implicit breaks, but not when there is an explicit "section break (next page)"?
Comment 4 Miklos Vajna 2024-12-03 15:53:51 UTC
It's a mess, page break ignores whitespace, but not "section break (next page)". I'll take a look.
Comment 5 Commit Notification 2024-12-06 15:16:54 UTC
Miklos Vajna committed a patch related to this issue.
It has been pushed to "master":

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

tdf#164095 sw: fix missing top margin on paragraph after changing page style

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 6 Miklos Vajna 2024-12-06 15:18:46 UTC
Should work now. Note that the commit adds a test doc that shows the top margin is wanted after "section break (next page)", but not after an explicit page break, so we do that to match Word.
Comment 7 Commit Notification 2024-12-09 07:56:47 UTC
Miklos Vajna committed a patch related to this issue.
It has been pushed to "libreoffice-25-2":

https://git.libreoffice.org/core/commit/64a5c93d4230ff0deccf2cccbaec52463ff07149

tdf#164095 sw: fix missing top margin on paragraph after changing page style

It will be available in 25.2.0.0.beta2.

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 2024-12-18 09:27:51 UTC
Miklos Vajna committed a patch related to this issue.
It has been pushed to "libreoffice-24-8":

https://git.libreoffice.org/core/commit/222b0cf18578d7407d67ef52370313b64bb1d7d7

tdf#164095 sw: fix missing top margin on paragraph after changing page style

It will be available in 24.8.5.

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.