Kaydet (Commit) 7ef02ac0 authored tarafından Mike Kaganski's avatar Mike Kaganski Kaydeden (comit) Thorsten Behrens

tdf#89007: Fix ShouldRowKeepWithNext condition

KeepWithNext shouldn't be applied to nested tables

Change-Id: I6df002ae7b00afa0fcf82aab584f85d9a47315eb
Reviewed-on: https://gerrit.libreoffice.org/15794Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarThorsten Behrens <Thorsten.Behrens@CIB.de>
üst 7068b56b
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment