diff options
author | Patrick Jaap <patrick.jaap@tu-dresden.de> | 2019-01-29 16:08:24 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2019-02-13 12:09:21 +0100 |
commit | 8e2d16b337fbd1602af26bd9b40d7e86cee5202e (patch) | |
tree | faa0569d7b0ce5a4ed8565826a1a832629ddf627 /sw/source | |
parent | ac1b2c9e1ab2f84de3a8856772e00302d237e82f (diff) |
tdf#123002 Disable off-page positioning for footer/header objects only
We should restrict this to this case since the anchor of objects in the
body may appear on another page when the object is moved around.
In constrast, objects in header and footer should not appear on other pages,
so we still disable the "off-page positioning" for them.
Horizontal off-page positioning should be disabled in any case.
See also
tdf#112443 and tdf#120839
Change-Id: I056c74526f38c302ba49297f9f84ec0e958d2cec
Reviewed-on: https://gerrit.libreoffice.org/67088
Tested-by: Jenkins
Tested-by: Xisco Faulí <xiscofauli@libreoffice.org>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'sw/source')
-rw-r--r-- | sw/source/core/objectpositioning/anchoredobjectposition.cxx | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/sw/source/core/objectpositioning/anchoredobjectposition.cxx b/sw/source/core/objectpositioning/anchoredobjectposition.cxx index d4d44e4ae199..c6724a34e0b4 100644 --- a/sw/source/core/objectpositioning/anchoredobjectposition.cxx +++ b/sw/source/core/objectpositioning/anchoredobjectposition.cxx @@ -484,10 +484,14 @@ SwTwips SwAnchoredObjectPosition::ImplAdjustVertRelPos( const SwTwips nTopOfAnch { // tdf#112443 if position is completely off-page // return the proposed position and do not adjust it... - // tdf#120839 .. unless anchored to char (anchor can jump on other page) - bool bDisablePositioning = mpFrameFormat->getIDocumentSettingAccess().get(DocumentSettingId::DISABLE_OFF_PAGE_POSITIONING); + const bool bDisablePositioning = mpFrameFormat->getIDocumentSettingAccess().get(DocumentSettingId::DISABLE_OFF_PAGE_POSITIONING); - if ( bDisablePositioning && !IsAnchoredToChar() && nTopOfAnch + nAdjustedRelPosY > aPgAlignArea.Bottom() ) + // tdf#123002 disable the positioning in header and footer only + // we should limit this since anchors of body frames may appear on other pages + const bool bIsFooterOrHeader = GetAnchorFrame().GetUpper() + && (GetAnchorFrame().GetUpper()->IsFooterFrame() || GetAnchorFrame().GetUpper()->IsHeaderFrame() ); + + if ( bDisablePositioning && bIsFooterOrHeader && nTopOfAnch + nAdjustedRelPosY > aPgAlignArea.Bottom() ) { return nProposedRelPosY; } |