Bug 166675 - FILEOPEN DOCX: no top spacing after empty paragraph with w:br (STYLEREF loses direct formatting)
Summary: FILEOPEN DOCX: no top spacing after empty paragraph with w:br (STYLEREF loses...
Status: NEW
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: Not Assigned
URL:
Whiteboard:
Keywords: bibisected, bisected, filter:docx
Depends on:
Blocks: DOCX-Paragraph
  Show dependency treegraph
 
Reported: 2025-05-21 17:41 UTC by Justin L
Modified: 2025-06-18 12:46 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
forum-mso-de-58343.docx: a simple example (55.77 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2025-05-21 17:41 UTC, Justin L
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Justin L 2025-05-21 17:41:26 UTC
Created attachment 200898 [details]
forum-mso-de-58343.docx: a simple example

The problem seen is a gap between the header and the body text, while there is no gap in Microsoft Word.

Steps to reproduce
1.) open forum-mso-de-58343.docx

On page 2, the text should start immediately after the header - with no gap (even though "1. Einleitung" has a top margin of 24 pt).

Currently, we see a gap of 14 pt (24 top margin - prev paragraph's 10pt bottom margin).

[Note that this kind of document is not possible in DOC format, because in that format we always have w:splitPgBreakAndParaMark.]

This started working in LO 7.6
with commit 96a502b3756a1c100b40235f50ef2122d5b543f9
Author: Justin Luth on Tue Mar 7 07:43:14 2023 -0500
    tdf#153964 writerfilter compat15: top margin after break split
    
    The problem was that the top margin was being applied
    to the new paragraph after the split.
    
    This is absolutely atrocious in MS Word before 2013.
    If I am going to be in error, I want to error on the side
    of being compliant with compat15, since all other versions
    of MS Word are now unsupported.
    
But it stopped in 24.2.4 and commit ab1697cb4c17fd7a2fbf8d374ac95fc03b4d00be
Author: Michael Stahl on Fri May 3 12:12:24 2024 +0200
    tdf#160402 filter,writerfilter: import locale-dependent STYLEREF names

This is not a direct regression. IIRC, during the process of applying the new style name, any direct-formatting is lost. (Ah yes, see bug 164908 comment 4.)

Also seen with forum-mso-de-41366.docx.
Comment 1 Jeremy Norvell 2025-05-24 22:54:16 UTC
I can confirm that a much larger gap is showing between the header and body in the versions of LibreOffice listed below. This same gap is not seen in MS-Word with the same document.

Version: 25.8.0.0.alpha1+ (X86_64) / LibreOffice Community
Build ID: 84da1f50ca8261129909901c2ff72adb9c67510a
CPU threads: 8; OS: macOS 15.2; UI render: Skia/Raster; VCL: osx
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded

Version: 25.2.3.2 (X86_64) / LibreOffice Community
Build ID: bbb074479178df812d175f709636b368952c2ce3
CPU threads: 8; OS: macOS 15.2; UI render: Skia/Raster; VCL: osx
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded