Kaydet (Commit) 8e2d16b3 authored tarafından Patrick Jaap's avatar Patrick Jaap Kaydeden (comit) Miklos Vajna

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: 's avatarXisco Faulí <xiscofauli@libreoffice.org>
Reviewed-by: 's avatarMiklos Vajna <vmiklos@collabora.com>
üst ac1b2c9e
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment