summaryrefslogtreecommitdiff
path: root/sw/source
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2024-09-19 18:43:35 +0500
committerMike Kaganski <mike.kaganski@collabora.com>2024-09-20 04:05:08 +0200
commitbfefb2bebd71fc63026b92b23555ce57e4feb536 (patch)
treef445b48db11b5c74fa696b7360f7ab247babd6d8 /sw/source
parent223a51801f0b75ae5036a8bcecc6eb81d99b113e (diff)
Re-calculate the available space before calling lcl_RecalcSplitLine
Because we could change the split row several times after first remaining space calculation, thus obsoleting the old value. Change-Id: Ia8027b0df2b04089c31b7031ddb05bd33e6ade98 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173674 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sw/source')
-rw-r--r--sw/source/core/layout/tabfrm.cxx9
1 files changed, 7 insertions, 2 deletions
diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx
index afbd321ab39b..cd7b33faa241 100644
--- a/sw/source/core/layout/tabfrm.cxx
+++ b/sw/source/core/layout/tabfrm.cxx
@@ -1440,7 +1440,7 @@ bool SwTabFrame::Split(const SwTwips nCutPos, bool bTryToSplit,
// we also don't shrink here, because we will be doing that in lcl_RecalcSplitLine
// recalculate the split line
- bRet = lcl_RecalcSplitLine(*pLastRow, *pFollowRow, nRemainingSpaceForLastRow, nShrink, rIsFootnoteGrowth);
+ bRet = lcl_RecalcSplitLine(*pLastRow, *pFollowRow, getRemainingAfter(pLastRow->GetPrev()), nShrink, rIsFootnoteGrowth);
// RecalcSplitLine did not work. In this case we conceal the split error:
if (!bRet && !bSplitRowAllowed)
@@ -5058,6 +5058,7 @@ void SwRowFrame::Format( vcl::RenderContext* /*pRenderContext*/, const SwBorderA
OSL_ENSURE( pAttrs, "SwRowFrame::Format without Attrs." );
const bool bFix = mbFixSize;
+ SwTabFrame* pTabFrame = FindTabFrame();
if ( !isFramePrintAreaValid() )
{
@@ -5075,7 +5076,6 @@ void SwRowFrame::Format( vcl::RenderContext* /*pRenderContext*/, const SwBorderA
// #i29550#
// Here we calculate the top-printing area for the lower cell frames
- SwTabFrame* pTabFrame = FindTabFrame();
if ( pTabFrame->IsCollapsingBorders() )
{
const sal_uInt16 nTopSpace = lcl_GetTopSpace( *this );
@@ -5212,6 +5212,11 @@ void SwRowFrame::Format( vcl::RenderContext* /*pRenderContext*/, const SwBorderA
{ nDiff -= aRectFnSet.GetHeight(pSibling->getFrameArea());
pSibling = pSibling->GetNext();
} while ( pSibling );
+ if (nDiff > 0 && pTabFrame->IsCollapsingBorders())
+ {
+ // In SwTabFrame::Format, this value will be added to the table's bottom margin
+ nDiff -= GetBottomLineSize();
+ }
if ( nDiff > 0 )
{
mbFixSize = false;