sw/qa/extras/ooxmlexport/data/tdf169986_bottomSpacing.docx |binary
 sw/qa/extras/ooxmlexport/ooxmlexport25.cxx                 |    6 ++++++
 sw/source/writerfilter/dmapper/PropertyMap.cxx             |    3 ++-
 3 files changed, 8 insertions(+), 1 deletion(-)

New commits:
commit e070494364f62e7d14ffcbfa87cafe708bacb1d6
Author:     Justin Luth <[email protected]>
AuthorDate: Mon Dec 15 15:50:45 2025 -0500
Commit:     Xisco Fauli <[email protected]>
CommitDate: Tue Dec 16 09:55:13 2025 +0100

    tdf#169986 docx import: no sectPr belowSpacing to footnotes
    
    This fixes my 25.2.6 regression from
    commit 1326e09d019f05a82265f15c26288b4ffb7dc0c2
    Author: Justin Luth on Mon Jul 28 09:29:51 2025
        tdf#167657 only move sectPr bottomMargin after pageBreak
    
    Footnotes (and comments) are always a CloseSectionGroup disaster.
    The section's belowSpacing should never transfer
    into a footnote - it only applies to the body paragraphs.
    
    Interestingly, the unit test does NOT fail,
    even though 2 pages are clearly seen interactively.
    I include it simply for possible future benefit.
    make CppunitTest_sw_ooxmlexport25 \
        CPPUNIT_TEST_NAME=testTdf169986_bottomSpacing
    
    Change-Id: I848ccda2ce2bb84de951c6da8f4001d217b8b38a
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195683
    Tested-by: Jenkins
    Reviewed-by: Justin Luth <[email protected]>
    (cherry picked from commit 01c39dcb622256a66bd11aaaa695729db9b27468)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195684
    (cherry picked from commit b5637481d060d01094e7ceef959744d96547cdbb)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195686
    Reviewed-by: Xisco Fauli <[email protected]>

diff --git a/sw/qa/extras/ooxmlexport/data/tdf169986_bottomSpacing.docx 
b/sw/qa/extras/ooxmlexport/data/tdf169986_bottomSpacing.docx
new file mode 100644
index 000000000000..c4e50257b58c
Binary files /dev/null and 
b/sw/qa/extras/ooxmlexport/data/tdf169986_bottomSpacing.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport25.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport25.cxx
index 3e73bd48092b..03d1677315a3 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport25.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport25.cxx
@@ -55,6 +55,12 @@ DECLARE_OOXMLEXPORT_TEST(testTdf166510_sectPr_bottomSpacing, 
"tdf166510_sectPr_b
     CPPUNIT_ASSERT_EQUAL(sal_Int32(4253), nHeight);
 }
 
+DECLARE_OOXMLEXPORT_TEST(testTdf169986_bottomSpacing, 
"tdf169986_bottomSpacing.docx")
+{
+    // given with a continuous section break with a lot of below spacing, and 
several footnotes...
+    CPPUNIT_ASSERT_EQUAL(1, getPages());
+}
+
 DECLARE_OOXMLEXPORT_TEST(testTdf167657_sectPr_bottomSpacing, 
"tdf167657_sectPr_bottomSpacing.docx")
 {
     // given with a continuous break sectPr with no belowSpacing
diff --git a/sw/source/writerfilter/dmapper/PropertyMap.cxx 
b/sw/source/writerfilter/dmapper/PropertyMap.cxx
index e54091ae22f4..d04774fbab64 100644
--- a/sw/source/writerfilter/dmapper/PropertyMap.cxx
+++ b/sw/source/writerfilter/dmapper/PropertyMap.cxx
@@ -1945,7 +1945,8 @@ void SectionPropertyMap::CloseSectionGroup( 
DomainMapper_Impl& rDM_Impl )
         // to the last paragraph before the section page break
         // so that the consolidation/collapse of this section's 1st 
paragraph's aboveSpacing
         // works correctly (since below spacing before a page break otherwise 
has no relevance).
-        if (pPrevSection && pPrevSection->GetBelowSpacing().has_value() && 
m_xPreStartingRange.is())
+        if (pPrevSection && pPrevSection->GetBelowSpacing().has_value() && 
m_xPreStartingRange.is()
+            && !rDM_Impl.IsInFootOrEndnote())
         {
             try
             {

Reply via email to