summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2017-07-12 17:53:40 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2017-07-12 21:17:28 +0200
commit5b9edf5d5779b9ce578084250a6c87808ddc5fa8 (patch)
treef67807017241cdb9103fc5b2b668d14558344a63
parentf65cbae8947c0462b35c8d3c3d5124e431b100b6 (diff)
tdf#108524 sw: allow frames in growable follow sects in SwFrame::IsMoveable()
In general the move of frames inside growable sections is not allowed, so that the behavior is deterministic: either the section grows or content is moved to a follow section frame. But in case of split sections it is necessary to allow the move of text frames inside growable section frames, otherwise it is impossible to move text frames from the last follow of a section frame to the previous one. This is necessary, but not enough to address the sub-problem described in comment 12 of the bug. At least now SwFlowFrame::MoveBwd() is invoked to consider moving the frame backwards, though. Change-Id: I0b79e9db72a4e335701491dd6f7745058901e176 Reviewed-on: https://gerrit.libreoffice.org/39873 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
-rw-r--r--sw/source/core/layout/findfrm.cxx6
1 files changed, 5 insertions, 1 deletions
diff --git a/sw/source/core/layout/findfrm.cxx b/sw/source/core/layout/findfrm.cxx
index 4a3d3722edd8..b4e61b7a19f4 100644
--- a/sw/source/core/layout/findfrm.cxx
+++ b/sw/source/core/layout/findfrm.cxx
@@ -1263,8 +1263,12 @@ static bool lcl_IsInSectionDirectly( const SwFrame *pUp )
if( pUp->IsColumnFrame() )
bSeenColumn = true;
else if( pUp->IsSctFrame() )
+ {
+ auto pSection = static_cast<const SwSectionFrame*>(pUp);
// Allow move of frame in case our only column is not growable.
- return bSeenColumn || !static_cast<const SwSectionFrame*>(pUp)->Growable();
+ // Also allow if there is a previous section frame (to move back).
+ return bSeenColumn || !pSection->Growable() || pSection->GetPrecede();
+ }
else if( pUp->IsTabFrame() )
return false;
pUp = pUp->GetUpper();