summaryrefslogtreecommitdiff
path: root/sw/source/core/objectpositioning
diff options
context:
space:
mode:
authorPatrick Jaap <patrick.jaap@tu-dresden.de>2017-11-29 12:41:33 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2017-12-11 15:39:10 +0100
commit8d62b79f168180c6992eb483ec864d473050635f (patch)
tree41fef4b75064d0c1d6e64809b8ea3b55c2959f7d /sw/source/core/objectpositioning
parent4b941b7b7fd79415935c8f2d3ce900eb64a40f66 (diff)
tdf#112443 disable off-page content positioning
Disable the positioning for objects that are completely off-page. During import, LO writer forces content always back to the page and causes unwanted content on the page in constrast to MSO. To achive this the top/left position of the content is compared to the bottom/right border of the clipping region. A new compatibility flag OFF_PAGE_POSITIONING is introduced for legacy rendering of legacy documents. A unit test demonstrates the issue. It resolves tdf#112443. Change-Id: I263c129f9f09ed909ad777a34f8b9ffc84d871e4 Reviewed-on: https://gerrit.libreoffice.org/43313 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'sw/source/core/objectpositioning')
-rw-r--r--sw/source/core/objectpositioning/anchoredobjectposition.cxx18
1 files changed, 18 insertions, 0 deletions
diff --git a/sw/source/core/objectpositioning/anchoredobjectposition.cxx b/sw/source/core/objectpositioning/anchoredobjectposition.cxx
index 0e7ec2e72ce0..94afc9ddc38d 100644
--- a/sw/source/core/objectpositioning/anchoredobjectposition.cxx
+++ b/sw/source/core/objectpositioning/anchoredobjectposition.cxx
@@ -455,6 +455,15 @@ SwTwips SwAnchoredObjectPosition::ImplAdjustVertRelPos( const SwTwips nTopOfAnch
}
else
{
+ /// tdf#112443 if position is completely off-page
+ // return the proposed position and do not adjust it.
+ bool bDisablePositioning = mpFrameFormat->getIDocumentSettingAccess().get(DocumentSettingId::DISABLE_OFF_PAGE_POSITIONING);
+
+ if ( bDisablePositioning && nTopOfAnch + nAdjustedRelPosY > aPgAlignArea.Right() )
+ {
+ return nProposedRelPosY;
+ }
+
if ( bCheckBottom &&
nTopOfAnch + nAdjustedRelPosY + aObjSize.Width() >
aPgAlignArea.Right() )
@@ -471,6 +480,15 @@ SwTwips SwAnchoredObjectPosition::ImplAdjustVertRelPos( const SwTwips nTopOfAnch
}
else
{
+ // tdf#112443 if position is completely off-page
+ // return the proposed position and do not adjust it.
+ bool bDisablePositioning = mpFrameFormat->getIDocumentSettingAccess().get(DocumentSettingId::DISABLE_OFF_PAGE_POSITIONING);
+
+ if ( bDisablePositioning && nTopOfAnch + nAdjustedRelPosY > aPgAlignArea.Bottom() )
+ {
+ return nProposedRelPosY;
+ }
+
// #i31805# - consider value of <bCheckBottom>
if ( bCheckBottom &&
nTopOfAnch + nAdjustedRelPosY + aObjSize.Height() >