Created attachment 198649 [details] Unexpected space above paragraph is added +++ This bug was initially created as a clone of Bug #160952 +++ It looks like an introduction of *SwFrame::IsCollapseUpper()* function from the commit 6200d89b905d51776ff4f3c8a84f338655ffaa7f is a workaround for 'purging' top margin, and not for collapsing top margin. Observations: +--------------------------------------------------------------+ | <TOP MARGIN>---<PARAGRAPH> SPACING BEHAVIOR | +--------------+-----------------------------------------------+ | | Open by | +--------------+---------------+---------------+---------------+ | FILE | Word | LO | LO | | | | 7.6.5.2 | 25.2.0.2 | +--------------+---------------+---------------+---------------+ | scratch.docx | NO additional | THERE IS | THERE IS | | | space | additional | | | | | space | additional | | | | | space | | | guess: | guess: LO | | | | ignored/ | can't ignore | guess: LO | | | collapsed | this | can't ignore | | | | | this | +--------------+---------------+---------------+---------------+ | scratch.docx | NO additional | NO additional | NO additional | | saved in | space | space | space | | LO25.2.0.2 | | | | | | guess: | guess: | guess: | | | margin value | margin value | margin value | | | is set to 0 | is set to 0 | is set to 0 | +--------------+---------------+---------------+---------------+ | scratch.docx | NO additional | THERE IS | THERE IS | | saved in | space | additional | additional | | Word 2412 | | space | space | | | | | | | | guess: | guess: LO | | | | ignored/ | can't ignore | guess: LO | | | collapsed | this | can't ignore | | | | | this | +--------------+---------------+---------------+---------------+ | https://www.tablesgenerator.com/text_tables# | +--------------+---------------+---------------+---------------+ attachment 193984 [details] is a DOCX file claimed to be created in Word 2013 -- 1) only existing paragraph on first page has 0 pt paragraph-spacing before -- 2) only existing paragraph on second page has 120 pt paragraph-spacing before Step to reproduce the problem: 1) Open the attached DOCX file (attachment 193984 [details]) in LO25.2.0.2 or earlier. Expected result: no top margin is displayed, like in Word. Actual result: 4.23 cm top margin is displayed.
Created attachment 198650 [details] Original 'minimal reproducer' by Miklos Vajna
Created attachment 198651 [details] 'REPRODUCER' saved in LO25.2.0.2
Created attachment 198652 [details] 'REPRODUCER' saved in Word 2412 (2024)
Mentioned software in comment 0: Microsoft® Word dla Microsoft 365 MSO (wersja 2412 kompilacji 16.0.18324.20092) 64-bitowa Version: 7.6.5.2 (X86_64) / LibreOffice Community Build ID: 38d5f62f85355c192ef5f1dd47c5c0c0c6d6598b CPU threads: 8; OS: Windows 10.0 Build 26100; UI render: Skia/Vulkan; VCL: win Locale: pl-PL (pl_PL); UI: en-US Calc: CL threaded Version: 25.2.0.2 (X86_64) / LibreOffice Community Build ID: 62af784cc06624122f17ee71c7cf13d906cbaed0 CPU threads: 8; OS: Windows 11 X86_64 (10.0 build 26100); UI render: Skia/Vulkan; VCL: win Locale: pl-PL (pl_PL); UI: en-US Calc: CL threaded
How attachment 193984 [details] DOCX was edited so that it have paragraph-spacing, but it is skipped when displaying?
BTW 25.2.0.2 RC did not exist at the moment of filing this ticket.
Thanks for filing the new bug. Let's reset assignee back to default till I or somebody else has the time to investigate this.
repro after my fixes landed for bug 165047. In MS Word 2010, it looks like LO is showing it - with Page 2 way down near the bottom of the page. So this must be a compatibilityMode 15 thing. Indeed, Scratch.docx's settings.xml has <w:compatSetting w:name="compatibilityMode" w:val="15"/>
<w:pPr> <w:pageBreakBefore/> </w:pPr> <w:r> <w:lastRenderedPageBreak/> <w:t>Page 2</w:t> I don't know if it is related, but this doesn't use the normal w:br for a page break. Actually, based on my experience I would have expected the top margin to be applied for compat15. So I'm a bit surprised at this result. Notice that the break is occurring INSIDE of a <w:p> paragraph. So technically this paragraph is on two pages. Thus the top margin is applied to the start of the paragraph (on page 1) and obviously then should not be applied again as the paragraph continues on page 2.
(In reply to Justin L from comment #9) > page break. Actually, based on my experience I would have expected the top > margin to be applied for compat15. Actually, compat15 NEVER applies the top margin after the page break. Compat14 does IF the page break is the first thing in the paragraph - before any runs. It is worth noting here that comment 2's 25.2 round-tripped file is compat12 instead of compat15. (fixed in 25.8). I remember being rather confused when trying to figure out what this bug report is about. I'm still confused, and in general I can't reproduce "additional space" in any of my bibisects. So I'm not sure what I "repro'd" in comment 8. This bug report should be re-evaluated using LO 25.8 and if there is still a problem, clear steps to reproduce should be provided. (25.8 will be entering beta this week, so I'm not expecting an immediate response...)
Created attachment 201052 [details] LO25.8 displays similar to Word 25.8 behaves as expected. So, I think, that this ticket could be closed. Version: 25.8.0.0.alpha1+ (X86_64) / LibreOffice Community Build ID: b559e6371c2abf5c75622f602da87f28ff499a91 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-05-31_03.35.26/