summaryrefslogtreecommitdiff
path: root/sw/source/core
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2017-10-30 16:32:39 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2017-10-31 11:10:08 +0100
commitdfdb003fd063d9731cabce49370441ad5b111833 (patch)
tree074ad66bd3bdd54e05318ede2c8eceae7f7d9713 /sw/source/core
parentd1d2e7177d109befedfcbd378f0b7ba587affcd9 (diff)
tdf#113520 sw split sections in tables: avoid empty page after content del
The problem was that since split sections are allowed in nested tables, deleting enough content so that the full content of a page is removed results in an empty page, having only a 0 height table. I.e. the split section gets removed properly, the inner table (and its row and column) as well, but the outer table is still there, though it is marked to have 0 height. This results in a situation that the previous page doesn't have free space (the in-table section tries to take as much space as it can), but on the other hand we try (and fail) to move the 0 height table on the current page to the previous one, as it doesn't have free space. At the end the "empty" page still has an invisible table frame, so it is not removed. Fix the problem by allowing the move of a 0 height follow table frame from the current page to the previous one, even it has no empty space. Reviewed-on: https://gerrit.libreoffice.org/44059 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org> (cherry picked from commit c9c956f2716c58e2573a9ac07073f712d736ed02) Conflicts: sw/source/core/layout/tabfrm.cxx Change-Id: I2a5fac88b8b7dc2b91d041b58a4ad1b328f56a6b
Diffstat (limited to 'sw/source/core')
-rw-r--r--sw/source/core/layout/tabfrm.cxx15
1 files changed, 13 insertions, 2 deletions
diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx
index 18838adf68a2..367374ef1c62 100644
--- a/sw/source/core/layout/tabfrm.cxx
+++ b/sw/source/core/layout/tabfrm.cxx
@@ -2075,7 +2075,13 @@ void SwTabFrame::MakeAll(vcl::RenderContext* pRenderContext)
SwTwips nDeadLine = (pTmp->*fnRect->fnGetPrtBottom)();
if ( bBrowseMode )
nDeadLine += pTmp->Grow( LONG_MAX, true );
- if( (Frame().*fnRect->fnBottomDist)( nDeadLine ) > 0 )
+ bool bFits = (Frame().*fnRect->fnBottomDist)( nDeadLine ) > 0;
+ if (!bFits && (GetFollow()->Frame().*fnRect->fnGetHeight)() == 0)
+ // The follow should move backwards, so allow the case
+ // when the upper has no space, but the follow is
+ // empty.
+ bFits = (Frame().*fnRect->fnBottomDist)( nDeadLine ) >= 0;
+ if (bFits)
{
// First, we remove an existing follow flow line.
if ( HasFollowFlowLine() )
@@ -3370,7 +3376,12 @@ bool SwTabFrame::ShouldBwdMoved( SwLayoutFrame *pNewUpper, bool, bool &rReformat
rReformat = true;
return true;
}
- if (!m_bLockBackMove && nSpace > 0)
+ bool bFits = nSpace > 0;
+ if (!bFits && (Frame().*fnRect->fnGetHeight)() == 0)
+ // This frame fits into pNewUpper in case it has no space, but this
+ // frame is empty.
+ bFits = nSpace >= 0;
+ if (!m_bLockBackMove && bFits)
{
// #i26945# - check, if follow flow line
// contains frame, which are moved forward due to its object