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

tdf#120839: Special handling for anchored-to-char frames

The anchor can move to other pages if the frame is moved.
To avoid removing the contents of the frame, exclude this case.

This resolves a regression introduced by
8d62b79f

Change-Id: Ie7acd3c58ef9055cbe449ec15d337f03a02e0edd
Reviewed-on: https://gerrit.libreoffice.org/62987
Tested-by: Jenkins
Reviewed-by: 's avatarMiklos Vajna <vmiklos@collabora.com>
üst 2dfe7702
......@@ -456,11 +456,12 @@ SwTwips SwAnchoredObjectPosition::ImplAdjustVertRelPos( const SwTwips nTopOfAnch
}
else
{
/// tdf#112443 if position is completely off-page
// return the proposed position and do not adjust it.
// 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);
if ( bDisablePositioning && nTopOfAnch + nAdjustedRelPosY > aPgAlignArea.Right() )
if ( bDisablePositioning && !IsAnchoredToChar() && nTopOfAnch + nAdjustedRelPosY > aPgAlignArea.Right() )
{
return nProposedRelPosY;
}
......@@ -482,10 +483,11 @@ SwTwips SwAnchoredObjectPosition::ImplAdjustVertRelPos( const SwTwips nTopOfAnch
else
{
// tdf#112443 if position is completely off-page
// return the proposed position and do not adjust it.
// 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);
if ( bDisablePositioning && nTopOfAnch + nAdjustedRelPosY > aPgAlignArea.Bottom() )
if ( bDisablePositioning && !IsAnchoredToChar() && 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