[Libreoffice-commits] core.git: sw/source

Miklos Vajna vmiklos at collabora.co.uk
Wed Jul 12 19:17:59 UTC 2017


 sw/source/core/layout/findfrm.cxx |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

New commits:
commit 5b9edf5d5779b9ce578084250a6c87808ddc5fa8
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Wed Jul 12 17:53:40 2017 +0200

    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 at collabora.co.uk>
    Tested-by: Jenkins <ci at libreoffice.org>

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();


More information about the Libreoffice-commits mailing list