[Libreoffice-commits] core.git: Branch 'libreoffice-6-4' - sw/qa sw/source

Samuel Mehrbrodt (via logerrit) logerrit at kemper.freedesktop.org
Tue Jul 7 12:10:26 UTC 2020


 sw/qa/extras/layout/data/tdf134472.odt |binary
 sw/qa/extras/layout/layout.cxx         |    8 ++++++++
 sw/source/core/layout/flowfrm.cxx      |    5 ++++-
 3 files changed, 12 insertions(+), 1 deletion(-)

New commits:
commit c68fc819f78312c17ef6c4aee20a3759a2b10280
Author:     Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
AuthorDate: Mon Jul 6 21:24:49 2020 +0200
Commit:     Thorsten Behrens <Thorsten.Behrens at CIB.de>
CommitDate: Tue Jul 7 14:09:58 2020 +0200

    tdf#134472 Only add spacing in header when flag is set
    
    Flag was set, but not evaluated in 9b5805d1ef2b9e9c4e8f389c069807bf4489ea95
    
    Change-Id: I46f19945be521e886baa0fc9a9a419d88c0915fe
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98224
    Tested-by: Jenkins
    Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
    (cherry picked from commit 70f9c3b8f03fb28215985a5b899bd8fae9cb3ac3)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98085
    Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>

diff --git a/sw/qa/extras/layout/data/tdf134472.odt b/sw/qa/extras/layout/data/tdf134472.odt
new file mode 100644
index 000000000000..a50c99c87622
Binary files /dev/null and b/sw/qa/extras/layout/data/tdf134472.odt differ
diff --git a/sw/qa/extras/layout/layout.cxx b/sw/qa/extras/layout/layout.cxx
index 774b495b31e8..62a94a242a37 100644
--- a/sw/qa/extras/layout/layout.cxx
+++ b/sw/qa/extras/layout/layout.cxx
@@ -470,6 +470,14 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFlysInBody)
     }
 }
 
+CPPUNIT_TEST_FIXTURE(SwLayoutWriter, TestTdf134272)
+{
+    SwDoc* pDoc = createDoc("tdf134472.odt");
+    CPPUNIT_ASSERT(pDoc);
+    xmlDocPtr pXmlDoc = parseLayoutDump();
+    assertXPath(pXmlDoc, "/root/page[1]/header/txt[2]/infos/bounds", "height", "843");
+}
+
 CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFlysInHeader)
 {
     loadURL("private:factory/swriter", nullptr);
diff --git a/sw/source/core/layout/flowfrm.cxx b/sw/source/core/layout/flowfrm.cxx
index 466e0e1855bc..6d83406583a7 100644
--- a/sw/source/core/layout/flowfrm.cxx
+++ b/sw/source/core/layout/flowfrm.cxx
@@ -1697,7 +1697,10 @@ SwTwips SwFlowFrame::CalcLowerSpace( const SwBorderAttrs* _pAttrs ) const
     }
 
     // tdf#128195 Consider para spacing below last paragraph in header
-    if (!m_rThis.IsInFly() && m_rThis.FindFooterOrHeader() && !GetFollow() && !m_rThis.GetIndNext())
+    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())
         nLowerSpace += _pAttrs->GetULSpace().GetLower() + _pAttrs->CalcLineSpacing();
 
     return nLowerSpace;


More information about the Libreoffice-commits mailing list