diff options
author | Manfred Blume <manfred.blume@cib.de> | 2017-12-08 15:01:51 +0100 |
---|---|---|
committer | Thorsten Behrens <Thorsten.Behrens@CIB.de> | 2017-12-22 00:20:40 +0100 |
commit | 18765b9fa739337d2d891513f6e2fb7c3ce23b50 (patch) | |
tree | 61acc1c9001d529d0df88affe48310187784cc99 /sw/source/core | |
parent | baaf6c12c8e9f785dc91e5d3db8b2f5072d4e3f5 (diff) |
tdf#114306 fix unexpected page break in row-spanned table
If a para gets moved off to another page, it never gets
moved back. Make IsMoveable() more symmetric, add condition
to MoveBwd to also claim table content back.
Change-Id: I5366eb824f0ef7016599c777786cbdf42f65b9b5
Reviewed-on: https://gerrit.libreoffice.org/46021
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Diffstat (limited to 'sw/source/core')
-rw-r--r-- | sw/source/core/layout/findfrm.cxx | 8 | ||||
-rw-r--r-- | sw/source/core/layout/flowfrm.cxx | 9 |
2 files changed, 14 insertions, 3 deletions
diff --git a/sw/source/core/layout/findfrm.cxx b/sw/source/core/layout/findfrm.cxx index 73d4a86c0bce..494920dc6281 100644 --- a/sw/source/core/layout/findfrm.cxx +++ b/sw/source/core/layout/findfrm.cxx @@ -1303,8 +1303,14 @@ bool SwFrame::IsMoveable( const SwLayoutFrame* _pLayoutFrame ) const _pLayoutFrame->IsInDocBody() || _pLayoutFrame->IsInFootnote() ) { + // If IsMovable() is called before a MoveFwd() the method + // may return false if there is no NextCellLeaf. If + // IsMovable() is called before a MoveBwd() the method may + // return false if there is no PrevCellLeaf. if ( _pLayoutFrame->IsInTab() && !IsTabFrame() && - ( !IsContentFrame() || !const_cast<SwFrame*>(this)->GetNextCellLeaf() ) ) + ( !IsContentFrame() || (!const_cast<SwFrame*>(this)->GetNextCellLeaf() + && !const_cast<SwFrame*>(this)->GetPrevCellLeaf()) ) + ) { bRetVal = false; } diff --git a/sw/source/core/layout/flowfrm.cxx b/sw/source/core/layout/flowfrm.cxx index 83043c78278f..78b78e61b8e9 100644 --- a/sw/source/core/layout/flowfrm.cxx +++ b/sw/source/core/layout/flowfrm.cxx @@ -2021,14 +2021,19 @@ bool SwFlowFrame::MoveBwd( bool &rbReformat ) const SwLayoutFrame* pUpperFrame = m_rThis.GetUpper(); while ( pUpperFrame ) { - if ( pUpperFrame->IsTabFrame() ) + if ( pUpperFrame->IsTabFrame() || pUpperFrame->IsRowFrame() ) { return false; } // If the text frame is a follow-section-in-table, that can move // backward as well. bool bIsFollowSection = pUpperFrame->IsSctFrame() && static_cast<const SwSectionFrame*>(pUpperFrame)->GetPrecede(); - if ( ( pUpperFrame->IsColumnFrame() && pUpperFrame->IsInSct() ) || bIsFollowSection ) + + // If the text frame is a follow-in-table, that can move + // backward as well. + bool bIsFollow = const_cast<SwLayoutFrame*>(pUpperFrame)->GetPrevCellLeaf(); + + if ( ( pUpperFrame->IsColumnFrame() && pUpperFrame->IsInSct() ) || bIsFollowSection || bIsFollow ) { break; } |