summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2017-06-16 08:35:05 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2017-08-24 11:21:21 +0200
commita679189743f3a2d1a15a4dad3557d6fa8975ef0e (patch)
tree2699731e3c5276190d4d9f18a394fdd0b9e686c6
parent17824b7c49d87062a0ffeaebcb194b604936f126 (diff)
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@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> (cherry picked from commit 6ade80cf142664e78954c7544534e9436ceb90c7)
-rw-r--r--sw/source/core/layout/findfrm.cxx15
1 files changed, 6 insertions, 9 deletions
diff --git a/sw/source/core/layout/findfrm.cxx b/sw/source/core/layout/findfrm.cxx
index 89cf31663e2c..fb5854a80c9c 100644
--- a/sw/source/core/layout/findfrm.cxx
+++ b/sw/source/core/layout/findfrm.cxx
@@ -1253,17 +1253,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();
@@ -1290,7 +1287,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;
}