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

Miklos Vajna vmiklos at collabora.co.uk
Fri Jun 16 10:59:03 UTC 2017


 sw/source/core/layout/findfrm.cxx |   15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)

New commits:
commit 6ade80cf142664e78954c7544534e9436ceb90c7
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Fri Jun 16 08:35:05 2017 +0200

    tdf#108524 sw: allow move of frame inside section without columns
    
    The intention here is to deny the move of a frame that's inside a table
    inside a section.  But the code also checked if there a column frame
    in-between, so it allowed the move for a frame in a section with 2 cols,
    but not without columns (which does not sound intentional, since that's
    a simpler case). So drop the requirement to have a column frame between
    the argument and the section frame, just check that there is no table
    frame in between.
    
    This is needed, but not enough to split the section in the bugdoc (but
    at least now the content of the section is marked as movable).
    
    Change-Id: I9155b291a19c692efc30f01f8e206fac5f1ccf81
    Reviewed-on: https://gerrit.libreoffice.org/38858
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>

diff --git a/sw/source/core/layout/findfrm.cxx b/sw/source/core/layout/findfrm.cxx
index 490a95439715..74942256bef4 100644
--- a/sw/source/core/layout/findfrm.cxx
+++ b/sw/source/core/layout/findfrm.cxx
@@ -1252,17 +1252,14 @@ void SwFrame::InvalidateNextPrtArea()
     }
 }
 
-/// @returns true if the frame _directly_ sits in a section with columns
-///     but not if it sits in a table which itself sits in a section with columns.
-static bool lcl_IsInColSct( const SwFrame *pUp )
+/// @returns true if the frame _directly_ sits in a section
+///     but not if it sits in a table which itself sits in a section.
+static bool lcl_IsInSectionDirectly( const SwFrame *pUp )
 {
-    bool bRet = false;
     while( pUp )
     {
-        if( pUp->IsColumnFrame() )
-            bRet = true;
-        else if( pUp->IsSctFrame() )
-            return bRet;
+        if( pUp->IsSctFrame() )
+            return true;
         else if( pUp->IsTabFrame() )
             return false;
         pUp = pUp->GetUpper();
@@ -1289,7 +1286,7 @@ bool SwFrame::IsMoveable( const SwLayoutFrame* _pLayoutFrame ) const
 
     if ( _pLayoutFrame && IsFlowFrame() )
     {
-        if ( _pLayoutFrame->IsInSct() && lcl_IsInColSct( _pLayoutFrame ) )
+        if ( _pLayoutFrame->IsInSct() && lcl_IsInSectionDirectly( _pLayoutFrame ) )
         {
             bRetVal = true;
         }


More information about the Libreoffice-commits mailing list