From f497d1dc27b4fee3db1e2228647a00971922eb5f Mon Sep 17 00:00:00 2001 From: Justin Luth Date: Tue, 31 Mar 2020 14:49:13 +0300 Subject: tdf#131707 sw layout try2: ConsiderTextWrap on positioning rework 7.0 commit 1052acae9a599c54e518c8fc17d6a994d8778757 jmux and I were working on related bugs at the same time. My patch happened to get committed before his. Since mine regressed, use jmux's version instead. This should fix tdf#119748 and tdf#123257 Change-Id: I705d9f6c4ac81216c31009948cf1c9150017bbf3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91420 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski Reviewed-by: Miklos Vajna --- sw/source/core/layout/frmtool.cxx | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) (limited to 'sw/source') diff --git a/sw/source/core/layout/frmtool.cxx b/sw/source/core/layout/frmtool.cxx index a7ffd2c51920..c7424c95d4a8 100644 --- a/sw/source/core/layout/frmtool.cxx +++ b/sw/source/core/layout/frmtool.cxx @@ -702,8 +702,7 @@ SwFlyNotify::~SwFlyNotify() // #i54138# - suppress restart of the layout process // on changed frame height. // Note: It doesn't seem to be necessary and can cause layout loops. - // Also suppress on initial positioning - required to trigger text wrapping (tdf#119748). - if ( bPosChgd && maFrame.Pos().X() != FAR_AWAY ) + if ( bPosChgd ) { // indicate a restart of the layout process pFly->SetRestartLayoutProcess( true ); @@ -712,21 +711,21 @@ SwFlyNotify::~SwFlyNotify() { // lock position pFly->LockPosition(); + } - if ( !pFly->ConsiderForTextWrap() ) - { - // indicate that object has to be considered for text wrap - pFly->SetConsiderForTextWrap( true ); - // invalidate 'background' in order to allow its 'background' - // to wrap around it. - pFly->NotifyBackground( pFly->GetPageFrame(), - pFly->GetObjRectWithSpaces(), - PrepareHint::FlyFrameArrive ); - // invalidate position of anchor frame in order to force - // a re-format of the anchor frame, which also causes a - // re-format of the invalid previous frames of the anchor frame. - pFly->AnchorFrame()->InvalidatePos(); - } + if ( !pFly->ConsiderForTextWrap() ) + { + // indicate that object has to be considered for text wrap + pFly->SetConsiderForTextWrap( true ); + // invalidate 'background' in order to allow its 'background' + // to wrap around it. + pFly->NotifyBackground( pFly->GetPageFrame(), + pFly->GetObjRectWithSpaces(), + PrepareHint::FlyFrameArrive ); + // invalidate position of anchor frame in order to force + // a re-format of the anchor frame, which also causes a + // re-format of the invalid previous frames of the anchor frame. + pFly->AnchorFrame()->InvalidatePos(); } } } -- cgit v1.2.3