sw/qa/extras/ooxmlexport/data/tdf156372.doc |binary
 sw/qa/extras/ooxmlexport/ooxmlexport19.cxx  |   11 +++++++++++
 sw/source/core/layout/flowfrm.cxx           |    6 ++++--
 3 files changed, 15 insertions(+), 2 deletions(-)

New commits:
commit a3b76c2cb216a55d60fdf8b4533ac02c7f37c005
Author:     Satya <skompe...@opentext.com>
AuthorDate: Wed Jul 19 14:14:27 2023 +0530
Commit:     Justin Luth <jl...@mail.com>
CommitDate: Wed Jul 19 21:30:08 2023 +0200

    tdf#156372 sw: Stop adding GetLower to every cell in header table
    
    The code was doubling the lower spacing of the last paragraph
    in every cell of the table. This change is to not add the space
    when in tables, since that was intended to only apply
    to the last paragraph in the header.
    
    make CppunitTest_sw_ooxmlexport19 CPPUNIT_TEST_NAME=testTdf156372
    
    Change-Id: Ia8c2b31e3e56302735e858c39f80cc35e190af6b
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154643
    Tested-by: Jenkins
    Reviewed-by: Justin Luth <jl...@mail.com>

diff --git a/sw/qa/extras/ooxmlexport/data/tdf156372.doc 
b/sw/qa/extras/ooxmlexport/data/tdf156372.doc
new file mode 100644
index 000000000000..3b8ade19f83d
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf156372.doc differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport19.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport19.cxx
index 329248532342..6e784193ba97 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport19.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport19.cxx
@@ -1048,6 +1048,17 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf150408_isLvl_RoundTrip)
     assertXPath(pXml, "/w:numbering/w:abstractNum/w:lvl[2]/w:isLgl");
 }
 
+DECLARE_OOXMLEXPORT_TEST(testTdf156372, "tdf156372.doc")
+{
+    sal_Int32 nHeight = parseDump("//page[1]/header/tab/row[1]/infos/bounds", 
"height").toInt32();
+    // Without a fix in place, this would fail with
+    // - Expected: 847
+    // - Actual  : 1327
+    CPPUNIT_ASSERT_DOUBLES_EQUAL(sal_Int32(847), nHeight, 5);
+
+    CPPUNIT_ASSERT_EQUAL(1, getPages());
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/layout/flowfrm.cxx 
b/sw/source/core/layout/flowfrm.cxx
index f30c34938c20..981736de7004 100644
--- a/sw/source/core/layout/flowfrm.cxx
+++ b/sw/source/core/layout/flowfrm.cxx
@@ -1851,9 +1851,11 @@ SwTwips SwFlowFrame::CalcLowerSpace( const 
SwBorderAttrs* _pAttrs ) const
     // tdf#128195 Consider para spacing below last paragraph in header
     bool bHasSpacingBelowPara = 
m_rThis.GetUpper()->GetFormat()->getIDocumentSettingAccess().get(
         DocumentSettingId::HEADER_SPACING_BELOW_LAST_PARA);
-    if (bHasSpacingBelowPara && !m_rThis.IsInFly() && 
m_rThis.FindFooterOrHeader() && !GetFollow()
-        && !m_rThis.GetIndNext())
+    if (bHasSpacingBelowPara && !m_rThis.IsInTab() && !m_rThis.IsInFly()
+        && m_rThis.FindFooterOrHeader() && !GetFollow() && 
!m_rThis.GetIndNext())
+    {
         nLowerSpace += _pAttrs->GetULSpace().GetLower() + 
_pAttrs->CalcLineSpacing();
+    }
 
     return nLowerSpace;
 }

Reply via email to