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-08-23 11:45:48 +0200
commit92310c27d6b23aa04d218a585d5010db6afe088c (patch)
tree2850eb5e35653259efa1fbcc6c31d6db29165cdf
parentebe38430d3119c1923c6d949c4815a53268c621f (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> (cherry picked from commit 5b9edf5d5779b9ce578084250a6c87808ddc5fa8)
-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 3ad50a012d13..116ccd430d63 100644
--- a/sw/source/core/layout/findfrm.cxx
+++ b/sw/source/core/layout/findfrm.cxx
@@ -1264,8 +1264,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();