Bug 164498 - FILEOPEN DOCX: header should be larger - floating tabled failed to cause empty paragraph to wrap below it.
Summary: FILEOPEN DOCX: header should be larger - floating tabled failed to cause empt...
Status: RESOLVED DUPLICATE of bug 104254
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
Depends on:
Blocks: DOCX-Paragraph
  Show dependency treegraph
 
Reported: 2024-12-28 00:39 UTC by Justin L
Modified: 2025-01-11 13:06 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:


Attachments
forum-mso-de-124831.docx: compat15: Heading1 paragraphs should honour the top margin in this document (57.15 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2024-12-28 00:39 UTC, Justin L
Details
forum-mso-de-124831.docx_mso.pdf: how it looks in Word 2019 (123.17 KB, application/pdf)
2024-12-28 00:40 UTC, Justin L
Details
Word 2021 UI rendering, empty para and floating table in header doesn't overlap (9.51 KB, image/png)
2025-01-07 07:33 UTC, Miklos Vajna
Details
Writer UI rendering, empty para and floating table in header overlaps (11.67 KB, image/png)
2025-01-07 07:35 UTC, Miklos Vajna
Details
164498_noHeader.docx - minimized (compat15) (54.82 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2025-01-10 17:09 UTC, Justin L
Details
164498_compat15.docx: minimal version (containing the header) (54.25 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2025-01-10 18:17 UTC, Justin L
Details
164498_compat15.docx_import-2.png: page 3 - Word 2019 is red, after comment0's patch is black (15.57 KB, image/png)
2025-01-10 18:19 UTC, Justin L
Details
164498_compat15.docx_prev-import-2.png: page 3 - Word 2019 is red, before comment0's patch is black (7.28 KB, image/png)
2025-01-10 18:20 UTC, Justin L
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Justin L 2024-12-28 00:39:42 UTC
Created attachment 198301 [details]
forum-mso-de-124831.docx: compat15: Heading1 paragraphs should honour the top margin in this document

Page 4's title "3  Zweites Kapitel" should be 0.85cm from the top of the header.
(So should "2  Erstes Kapitel", but that is an earlier bug.)

The specified top margin is now ignored in 24.2.4. It started with
24.8 commit 6200d89b905d51776ff4f3c8a84f338655ffaa7f
Author: Miklos Vajna on Tue May 7 08:13:37 2024 +0200
    tdf#160952 sw: ignore top margin of para on non-first pages with newer DOCX

Steps to reproduce:
1.) Open forum-mso-de-124831.docx and go to page 4.

Note that there isn't really any margin above the heading. In comparison with MS Word 2019, the gap in LO from the line in the header is not large enough.

I suspect that when there is a style's
    <w:pageBreakBefore/>
then it should be treated similar to section break? (or else there must be some other kind of layout setting...)
(That's the difference with point #2. That one has a w:br page break AS WELL AS thie pageBreakBefore. There is no w:br before point #3.)

---------------------------------------------
Note: the problem with "2 Erstes Kapital" started in 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
Comment 1 Justin L 2024-12-28 00:40:53 UTC
Created attachment 198302 [details]
forum-mso-de-124831.docx_mso.pdf: how it looks in Word 2019
Comment 2 raal 2025-01-04 06:38:27 UTC
Confirm Version: 25.8.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: cac9c7db6257b27724d90d4a355e52e456ef7e08
CPU threads: 4; OS: Linux 6.8; UI render: default; VCL: x11
Locale: cs-CZ (cs_CZ.UTF-8); UI: en-US
Calc: threaded
Comment 3 Miklos Vajna 2025-01-06 08:08:04 UTC
Hmm, need to find a way that fixes this bug, while it keeps bug 160952 and bug 164095 fixed.
Comment 4 Justin L 2025-01-06 13:42:07 UTC Comment hidden (no-value)
Comment 5 Miklos Vajna 2025-01-07 07:32:10 UTC
Interesting, so far I have a completely different analysis. :-)

It seems to me that the lack of top margin is correct; what's wrong is the floating table in the header. Looking at Word, the floating table is wrapper around by the empty paragraph, so the empty paragraph takes extra space below the floating table in the header, leading to extra spacing.

Writer has the floating table and the normal header content overlapping, so the header takes less space, leading to a mismatch. I'll attach Word and Writer screenshots.

If my analysis is correct, then the above commit just uncovered an already existing problem and this should be an implementation error from the floating table feature. What do you think?
Comment 6 Miklos Vajna 2025-01-07 07:33:46 UTC
Created attachment 198409 [details]
Word 2021 UI rendering, empty para and floating table in header doesn't overlap
Comment 7 Miklos Vajna 2025-01-07 07:35:20 UTC
Created attachment 198410 [details]
Writer UI rendering, empty para and floating table in header overlaps
Comment 8 Justin L 2025-01-10 17:09:15 UTC
Created attachment 198474 [details]
164498_noHeader.docx - minimized (compat15)

(In reply to Miklos Vajna from comment #5)
> If my analysis is correct, ... What do you think?
It appears I must be wrong. 

When I load this minimized version into Word 2019, all the text starts at the top of the page. (When I load it into Word 2010, then the text starts in the middle-ish of the page.) So your comment 0 patch fixed the third page for this document (and doesn't break a compat14 version).
Comment 9 Justin L 2025-01-10 18:17:10 UTC
Created attachment 198479 [details]
164498_compat15.docx: minimal version (containing the header)
Comment 10 Justin L 2025-01-10 18:19:31 UTC
Created attachment 198480 [details]
164498_compat15.docx_import-2.png: page 3 - Word 2019 is red, after comment0's patch is black
Comment 11 Justin L 2025-01-10 18:20:21 UTC
Created attachment 198481 [details]
164498_compat15.docx_prev-import-2.png: page 3 - Word 2019 is red, before comment0's patch is black
Comment 12 Justin L 2025-01-10 18:23:24 UTC
(In reply to Miklos Vajna from comment #5)
> then the above commit just uncovered an already existing problem
Yes. As the above (exaggerated) minimal example shows, it wasn't correct before your comment 0 patch either.
Comment 13 Justin L 2025-01-10 18:30:01 UTC
(In reply to Justin L from comment #0)
 Note: the problem with "2 Erstes Kapital" started in 7.6 with
>     tdf#153964 writerfilter compat15: top margin after break split
Yay, that means that this commit is correct after all...
Comment 14 Justin L 2025-01-11 13:06:01 UTC
(In reply to Miklos Vajna from comment #5)
> Interesting, so far I have a completely different analysis. :-)
> 
> Looking at Word, the floating table is wrapped
> around by the empty paragraph, so the empty paragraph takes extra space
> below the floating table in the header, leading to extra spacing.

So then it is just a duplicate of bug 104254
    image in header overlaps header text in compat15 mode

*** This bug has been marked as a duplicate of bug 104254 ***