sw/source/core/objectpositioning/anchoredobjectposition.cxx | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-)
New commits: commit 98e84dc591e23bd8e43c7c6d5ec6511eafa91900 Author: Patrick Jaap <patrick.j...@tu-dresden.de> AuthorDate: Wed Nov 7 08:45:46 2018 +0100 Commit: Miklos Vajna <vmik...@collabora.com> CommitDate: Fri Dec 14 16:08:40 2018 +0100 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 8d62b79f168180c6992eb483ec864d473050635f Change-Id: Ie7acd3c58ef9055cbe449ec15d337f03a02e0edd Reviewed-on: https://gerrit.libreoffice.org/62987 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmik...@collabora.com> diff --git a/sw/source/core/objectpositioning/anchoredobjectposition.cxx b/sw/source/core/objectpositioning/anchoredobjectposition.cxx index 5cd671c934ce..d4d44e4ae199 100644 --- a/sw/source/core/objectpositioning/anchoredobjectposition.cxx +++ b/sw/source/core/objectpositioning/anchoredobjectposition.cxx @@ -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; } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits