summaryrefslogtreecommitdiff
path: root/sw/source/core/objectpositioning
diff options
context:
space:
mode:
authorPatrick Jaap <patrick.jaap@tu-dresden.de>2018-11-07 08:45:46 +0100
committerMiklos Vajna <vmiklos@collabora.com>2018-12-14 16:08:40 +0100
commit98e84dc591e23bd8e43c7c6d5ec6511eafa91900 (patch)
tree2d3a3c8beddadb737aed35811442efb63c25280d /sw/source/core/objectpositioning
parent2dfe7702a08e74a140f2e55f1625ab780f0e8c2a (diff)
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 <vmiklos@collabora.com>
Diffstat (limited to 'sw/source/core/objectpositioning')
-rw-r--r--sw/source/core/objectpositioning/anchoredobjectposition.cxx12
1 files changed, 7 insertions, 5 deletions
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;
}