summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <michael.stahl@allotropia.de>2023-07-18 16:58:34 +0200
committerMichael Stahl <michael.stahl@allotropia.de>2023-07-19 11:31:05 +0200
commit34b607bb455bd30d3adf8e3f72182c7cc4d062ee (patch)
treeaf35487c45737956f4ae1e4f69ebb8635e54375c
parent473da3a79758b061409ca6f0d8a41a0a91541842 (diff)
tdf#148729 sw: invalidate section frame for new text frame at start
SwFlowFrame::CalcUpperSpace() uses the first text frame inside to compute the upper margin of section frames. Before commit 69d2d24b3579ad21fb1ba2746f81a02f8bbfb984 this was working because a temporary SwTextFrame for the new SwTextNode was created and then deleted again, but while it was alive the SvULSpace item was copied and then it invalidated the section frame: 1 SwFrame::InvalidatePrt_() 2 SwContentFrame::Modify() at libreoffice-6-1/sw/source/core/layout/wsfrm.cxx:2336 3 SwTextFrame::SwClientNotify() ... 7 SwTextNode::Modify() 8 SwContentNode::SetAttr() 9 SwTextNode::SetAttr() 10 SwAttrSet::CopyToModify() 11 SwTextNode::CopyText() 12 SwTextNode::CopyText() 13 SwTextNode::MakeCopy() 14 SwNodes::CopyNodes() 15 sw::DocumentContentOperationsManager::CopyWithFlyInFly() 16 SwIntrnlSectRefLink::DataChanged() Now however nothing invalidates the section frame, so do it in InsertCnt_(), hopefully it works for columned sections too. (regression from commit 166b5010b402a41b192b1659093a25acf9065fd9) Change-Id: I339286ac37c9ee9a0bef730a73215bc139386514 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154594 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
-rw-r--r--sw/source/core/layout/frmtool.cxx10
1 files changed, 10 insertions, 0 deletions
diff --git a/sw/source/core/layout/frmtool.cxx b/sw/source/core/layout/frmtool.cxx
index 9c8d6cbe85bf..666577971534 100644
--- a/sw/source/core/layout/frmtool.cxx
+++ b/sw/source/core/layout/frmtool.cxx
@@ -1605,6 +1605,16 @@ void InsertCnt_( SwLayoutFrame *pLay, SwDoc *pDoc,
pPageMaker->CheckInsert( nIndex );
pFrame->InsertBehind( pLay, pPrv );
+ if (!pPrv)
+ {
+ if (SwSectionFrame *const pSection = pLay->FindSctFrame())
+ {
+ if (pSection && pSection->ContainsAny() == pFrame)
+ { // tdf#148729 section PrtArea depends on paragraph upper margin
+ pSection->InvalidatePrt();
+ }
+ }
+ }
// #i27138#
// notify accessibility paragraphs objects about changed
// CONTENT_FLOWS_FROM/_TO relation.