There are two (related) parts to this bug. First, something that has never worked is the general case that a continuous section break's below spacing should be used to consolidate the top margin of the following paragraph. This is rather complicated, because the sectPr paragraph doesn't actually exist in Writer, and even in MS Word, the above and below spacing doesn't directly affect the layout. (For example, if a continuous sectPr has below spacing of 100pt, it wouldn't produce a large gap.) HOWEVER, if the following paragraph had a 100pt top margin, then the sectPr's below spacing would "swallow up" the top margin, and there would still not be any gap in the layout. Currently in Writer we have no way of swallowing up that gap, so we show it. Secondly however, as in bug 166510, this can be emulated IF the continuous section is connected with a page break. This was working from 25.2.4 - 25.2.6. It broke in 25.2.6 with commit 74c29345a7c179b048c157582a1145e381616e5c Author: Justin Luth on Mon Jul 28 09:29:51 2025 +0200 tdf#167657 writerfilter: only move sectPr bottomMargin after pageBreak Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188298
Created attachment 204796 [details] 170119_continuousSectionNoGap.docx: 1 page document This document is an example of the generic situation. The sectPr has belowSpacing of 200pt. However, that doesn't produce a gap. The paragraph before the section break has a 200pt above spacing. LibreOffice is showing that gap (by pushing the content to page 2).
Created attachment 204797 [details] 170119_continuousSectionNoGap_word2024.pdf: how it looks in MS Word
Please have a look at bug 107497, bug 84248 and bug 124637. Has this bug a underlying problem that is common with them?
(In reply to Regina Henschel from comment #3) > Please have a look at bug 107497, bug 84248 and bug 124637. Has this bug a > underlying problem that is common with them? No, it doesn't seem to be related to any of these. (This is an MSO-only issue)
Justin Luth committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/582c032aaa4524abf5b5a630400cf7ecdc2acf8a tdf#170119 writerfilter: cont-sectPr w/ pgbrk == emulate bottomSpacing It will be available in 26.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's patch depends on bu 170003. It does NOT fix the first, general case, but it does resolve the 'regression' when there is an accompanying general page break.
Justin Luth committed a patch related to this issue. It has been pushed to "libreoffice-26-2": https://git.libreoffice.org/core/commit/ed5aaa03906807c93fe6847f66f847007777174d tdf#170119 writerfilter: cont-sectPr w/ pgbrk == emulate bottomSpacing It will be available in 26.2.0.2. 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.