diff options
author | Michael Stahl <michael.stahl@allotropia.de> | 2023-08-17 13:30:38 +0200 |
---|---|---|
committer | Michael Stahl <michael.stahl@allotropia.de> | 2023-08-18 10:57:21 +0200 |
commit | ee82accbd0d67eaf0f5a164a82b86abd00c3b0c9 (patch) | |
tree | 77b7a820e3af660ddf6a1714c79e9766028089cc /sw/source | |
parent | c351f920c426542f0d3685bb9df1363d3a6393f8 (diff) |
tdf#156728 sw: layout: invalidate fly on header/footer size
On page 30 there are at-page anchored shapes Shape22, Shape23 and
Shape25.
Shape22 and Shape23 are positioned relative to the bottom of the page
text area, and that is working; Shape25 is positioned with an offset to
the top of the page text area, and that doesn't work.
The problem is that the shapes are positioned when the header on the
page hasn't been formatted yet, and once the header is formatted, the
position of the Shape25 is not invalidated, so it's a header-height too
far up.
(regression from commit 425a252c3cc5e5a79a533965026dd4af6b8df739)
Change-Id: Ic907d98b1bcd4bb544fd1af9bf93ebc7b75bf362
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155762
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Diffstat (limited to 'sw/source')
-rw-r--r-- | sw/source/core/layout/fly.cxx | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/sw/source/core/layout/fly.cxx b/sw/source/core/layout/fly.cxx index c2d27eaf2f0e..a06c2a9e7f70 100644 --- a/sw/source/core/layout/fly.cxx +++ b/sw/source/core/layout/fly.cxx @@ -2718,10 +2718,23 @@ void SwLayoutFrame::NotifyLowerObjs( const bool _bUnlockPosOfObjs ) { assert( dynamic_cast<const SwAnchoredDrawObject*>( pObj) && "<SwLayoutFrame::NotifyFlys() - anchored object of unexpected type" ); + // tdf#156728 invalidate fly positioned dependent on header/footer size + bool isPositionedByHF(false); + if (IsHeaderFrame() || IsFooterFrame()) + { + auto const nO(pObj->GetFrameFormat().GetVertOrient().GetRelationOrient()); + if (nO == text::RelOrientation::PAGE_PRINT_AREA + || nO == text::RelOrientation::PAGE_PRINT_AREA_BOTTOM + || nO == text::RelOrientation::PAGE_PRINT_AREA_TOP) + { + isPositionedByHF = true; + } + } // #i26945# - use <pAnchorFrame> to check, if // fly frame is lower of layout frame resp. if fly frame is // at a different page registered as its anchor frame is on. if ( IsAnLower( pAnchorFrame ) || + isPositionedByHF || pAnchorFrame->FindPageFrame() != pPageFrame ) { // #i44016# |