diff options
author | Mike Kaganski <mikekaganski@hotmail.com> | 2015-05-19 14:55:52 +1000 |
---|---|---|
committer | Thorsten Behrens <Thorsten.Behrens@CIB.de> | 2015-07-15 23:15:14 +0000 |
commit | 7ef02ac0ad217240c9adc6279f54342a066182aa (patch) | |
tree | 8df3fadd852b5ee673d23c58ce69a45b70dd5eda /sw | |
parent | 7068b56ba93470c9329e2537fa24b1b1a11487fa (diff) |
tdf#89007: Fix ShouldRowKeepWithNext condition
KeepWithNext shouldn't be applied to nested tables
Change-Id: I6df002ae7b00afa0fcf82aab584f85d9a47315eb
Reviewed-on: https://gerrit.libreoffice.org/15794
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/layout/tabfrm.cxx | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx index 8bb796a1f2da..51c0e26e2d15 100644 --- a/sw/source/core/layout/tabfrm.cxx +++ b/sw/source/core/layout/tabfrm.cxx @@ -1788,6 +1788,8 @@ void SwTabFrm::MakeAll(vcl::RenderContext* pRenderContext) // keep for the first paragraph in the first cell), and this table does // not have a next, the last line will be cut. Loop prevention: Only // one try. + // WHAT IS THIS??? It "magically" hides last line (paragraph) in a table, + // if first is set to keep with next??? bool bLastRowHasToMoveToFollow = false; bool bLastRowMoveNoMoreTries = false; @@ -4383,16 +4385,15 @@ bool SwRowFrm::IsRowSplitAllowed() const bool SwRowFrm::ShouldRowKeepWithNext() const { - bool bRet = false; + // No KeepWithNext if nested in another table + if ( GetUpper()->GetUpper()->IsCellFrm() ) + return false; const SwCellFrm* pCell = static_cast<const SwCellFrm*>(Lower()); const SwFrm* pText = pCell->Lower(); - if ( pText && pText->IsTextFrm() ) - { - bRet = static_cast<const SwTextFrm*>(pText)->GetTextNode()->GetSwAttrSet().GetKeep().GetValue(); - } - return bRet; + return pText && pText->IsTextFrm() && + static_cast<const SwTextFrm*>(pText)->GetTextNode()->GetSwAttrSet().GetKeep().GetValue(); } SwCellFrm::SwCellFrm(const SwTableBox &rBox, SwFrm* pSib, bool bInsertContent) |