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>
diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx
index 8bb796a..51c0e26 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)