summaryrefslogtreecommitdiff
path: root/sw/source
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source')
-rw-r--r--sw/source/core/layout/flylay.cxx4
-rw-r--r--sw/source/core/objectpositioning/anchoredobjectposition.cxx8
-rw-r--r--sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx14
3 files changed, 21 insertions, 5 deletions
diff --git a/sw/source/core/layout/flylay.cxx b/sw/source/core/layout/flylay.cxx
index 1589c12670fe..4a7030ea241e 100644
--- a/sw/source/core/layout/flylay.cxx
+++ b/sw/source/core/layout/flylay.cxx
@@ -501,11 +501,11 @@ void SwFlyFreeFrame::CheckClip( const SwFormatFrameSize &rSz )
!GetDrawObjs() && !GetAnchorFrame()->IsInTab() )
{
SwFrame* pHeader = FindFooterOrHeader();
- // In a header or footer, correction of the position is no good idea.
+ // In a header, correction of the position is no good idea.
// If the fly moves, some paragraphs have to be formatted, this
// could cause a change of the height of the headerframe,
// now the flyframe can change its position and so on ...
- if ( !pHeader )
+ if ( !pHeader || !pHeader->IsHeaderFrame() )
{
const long nOld = getFrameArea().Top();
diff --git a/sw/source/core/objectpositioning/anchoredobjectposition.cxx b/sw/source/core/objectpositioning/anchoredobjectposition.cxx
index 09f6b33c5458..f60e097a01bb 100644
--- a/sw/source/core/objectpositioning/anchoredobjectposition.cxx
+++ b/sw/source/core/objectpositioning/anchoredobjectposition.cxx
@@ -881,7 +881,13 @@ SwTwips SwAnchoredObjectPosition::CalcRelPosX(
// keep object inside 'page' alignment layout frame
const SwFrame& rEnvironmentLayFrame =
_rEnvOfObj.GetHoriEnvironmentLayoutFrame( _rHoriOrientFrame );
- nRelPosX = AdjustHoriRelPos( rEnvironmentLayFrame, nRelPosX );
+ bool bFollowTextFlow = GetFrameFormat().GetFollowTextFlow().GetValue();
+ bool bWrapThrough = GetFrameFormat().GetSurround().GetSurround() != text::WrapTextMode_THROUGH;
+ // Don't try to keep wrap-though objects inside the cell, even if they are following text flow.
+ if (!rEnvironmentLayFrame.IsInTab() || !bFollowTextFlow || bWrapThrough)
+ {
+ nRelPosX = AdjustHoriRelPos( rEnvironmentLayFrame, nRelPosX );
+ }
// if object is a Writer fly frame and it's anchored to a content and
// it is horizontal positioned left or right, but not relative to character,
diff --git a/sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx b/sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx
index ec4ceeb61578..1e7f36f7b0e8 100644
--- a/sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx
+++ b/sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx
@@ -632,7 +632,12 @@ void SwToContentAnchoredObjectPosition::CalcPosition()
// <lcl_DoesVertPosFits(..)>.
if ( pLayoutFrameToGrow )
{
- pLayoutFrameToGrow->Grow( nRelPosY - nAvail );
+ // No need to grow the anchor cell in case the follow-text-flow object
+ // is wrap-though.
+ if (!GetAnchorFrame().IsInTab() || !DoesObjFollowsTextFlow() || !bWrapThrough)
+ {
+ pLayoutFrameToGrow->Grow( nRelPosY - nAvail );
+ }
}
nRelPosY = 0;
}
@@ -789,7 +794,12 @@ void SwToContentAnchoredObjectPosition::CalcPosition()
}
if ( pLayoutFrameToGrow )
{
- pLayoutFrameToGrow->Grow( -nDist );
+ // No need to grow the anchor cell in case the follow-text-flow object
+ // is wrap-though.
+ if (!GetAnchorFrame().IsInTab() || !DoesObjFollowsTextFlow() || !bWrapThrough)
+ {
+ pLayoutFrameToGrow->Grow( -nDist );
+ }
}
}