diff options
author | Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> | 2020-07-06 21:24:49 +0200 |
---|---|---|
committer | Thorsten Behrens <Thorsten.Behrens@CIB.de> | 2020-07-07 14:09:53 +0200 |
commit | 4d9f1afa79b1446a9cab805de42bd7a8851a006a (patch) | |
tree | ab5610b6d958e350c11f0c187f92ec0450ff0d1c | |
parent | 997e7011877b6559fce7173972c73fe0917212cb (diff) |
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@cib.de>
(cherry picked from commit 70f9c3b8f03fb28215985a5b899bd8fae9cb3ac3)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98084
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
-rw-r--r-- | sw/qa/extras/layout/data/tdf134472.odt | bin | 0 -> 13403 bytes | |||
-rw-r--r-- | sw/qa/extras/layout/layout.cxx | 9 | ||||
-rw-r--r-- | sw/source/core/layout/flowfrm.cxx | 5 |
3 files changed, 13 insertions, 1 deletions
diff --git a/sw/qa/extras/layout/data/tdf134472.odt b/sw/qa/extras/layout/data/tdf134472.odt Binary files differnew file mode 100644 index 000000000000..a50c99c87622 --- /dev/null +++ b/sw/qa/extras/layout/data/tdf134472.odt diff --git a/sw/qa/extras/layout/layout.cxx b/sw/qa/extras/layout/layout.cxx index f24a37ba3704..9e0ee4c66c66 100644 --- a/sw/qa/extras/layout/layout.cxx +++ b/sw/qa/extras/layout/layout.cxx @@ -453,6 +453,15 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFlysInBody) } } +CPPUNIT_TEST_FIXTURE(SwLayoutWriter, TestTdf134272) +{ + SwDoc* pDoc = createDoc("tdf134472.odt"); + CPPUNIT_ASSERT(pDoc); + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); + assertXPath(pXmlDoc, "/root/page[1]/header/txt[2]/infos/bounds", "height", "843"); + assertXPath(pXmlDoc, "/root/page[1]/header/txt[2]/infos/bounds", "bottom", "2819"); +} + 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 06b9db38fefd..73c939ec1a40 100644 --- a/sw/source/core/layout/flowfrm.cxx +++ b/sw/source/core/layout/flowfrm.cxx @@ -1712,7 +1712,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; |