sw/source/core/layout/tabfrm.cxx | 12 ++++++------ sw/source/core/text/txtfrm.cxx | 2 +- sw/source/core/text/widorp.cxx | 1 + 3 files changed, 8 insertions(+), 7 deletions(-)
New commits: commit 6a5cadc1ede1ab56c1830ffe93e1cc179733e891 Author: Michael Stahl <[email protected]> AuthorDate: Tue Feb 26 19:12:38 2019 +0100 Commit: Thorsten Behrens <[email protected]> CommitDate: Wed Mar 13 16:56:39 2019 +0100 tdf#122892 sw: fix disappearing rows after table split After fixing the infinite loop, the content of the merged table cell with rowspan 3 is invisible, because its SwCellFrame and the SwRowFrame containing it both have a height of 0. This is due to funny code in SwTabFrame::Split(), which checks the bRet flag before setting it to its final value, thus skipping the lcl_AdjustRowSpanCells() call. Change-Id: I96f9e9efdd5cae3a61da07995b8c31042fc59125 Reviewed-on: https://gerrit.libreoffice.org/68403 Tested-by: Jenkins Reviewed-by: Michael Stahl <[email protected]> (cherry picked from commit b891226dcee036fd8aad8320c7007b75b10b23c5) Reviewed-on: https://gerrit.libreoffice.org/68678 Reviewed-by: Thorsten Behrens <[email protected]> (cherry picked from commit 5ccbdb6551931a18bb60a961455f93ac918cc7e8) Reviewed-on: https://gerrit.libreoffice.org/69188 Tested-by: Thorsten Behrens <[email protected]> diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx index 8e3d9b1d93c3..b8d66ec2ef92 100644 --- a/sw/source/core/layout/tabfrm.cxx +++ b/sw/source/core/layout/tabfrm.cxx @@ -1290,16 +1290,16 @@ bool SwTabFrame::Split( const SwTwips nCutPos, bool bTryToSplit, bool bTableRowK // recalculate the split line bRet = lcl_RecalcSplitLine( *pLastRow, *pFollowRow, nRemainingSpaceForLastRow, nShrink ); + // RecalcSplitLine did not work. In this case we conceal the split error: + if (!bRet && !bSplitRowAllowed) + { + bRet = true; + } + // NEW TABLES // check if each cell in the row span line has a good height if ( bRet && pFollowRow->IsRowSpanLine() ) lcl_AdjustRowSpanCells( pFollowRow ); - - // We The RowSplitLine stuff did not work. In this case we conceal the split error: - if ( !bRet && !bSplitRowAllowed ) - { - bRet = true; - } } return bRet; commit 9c3ad0c68f5e0f9924ca3145efd5e0d7b4c70626 Author: Michael Stahl <[email protected]> AuthorDate: Tue Feb 26 18:47:46 2019 +0100 Commit: Thorsten Behrens <[email protected]> CommitDate: Wed Mar 13 16:56:28 2019 +0100 tdf#122892 sw: fix IsPrepWidow() loop in SwTextFrame::CalcFollow() The bugdoc loops on calculating the follow of SwTextFrame 560, the one containing "Hiermit nehme ich das Angebot an" in a cell with rowspan 3, while the table is being split and its first row (also now its last i.e. split row) is being formatted. Loop in CalcFollow() because the follow is in the same upper frame as its master and cannot move forward, so the 2nd call to pMyFollow->Calc() after pMyFollow->Prepare() always sets the SetPrepWidows() flag on the master and in that case the loop never terminates. The problem is that the check in WidowsAndOrphans::FindWidows() of GetThisLines() uses stale cached data - the value returned is 4, but the frame contains fewer lines at that point and doesn't have lines to spare for the follow; the cached value is only updated at the end of SwTextFrame::Format(). Fix it by calling ChgThisLines() here. But this fix only helps for the first SwTextFrame in a cell; the next one with id 561 loops in a similar way. The problem then is that SwTextFrame::PrepWidows() always calls SetPrepWidows(), even if the Orphan-rule of the frame prevents it from giving lines to the follow. Fix this by calling SetPrepWidows() only if lines are removed. This also helps for the 2 attachments of tdf#118104. (regression from commit 18765b9fa739337d2d891513f6e2fb7c3ce23b50 particularly the change in SwFrame::IsMoveable() in the sense that it didn't loop before but there isn't anything obviously wrong with this commit) Change-Id: Ia1e5928a6510e68520b29eb265e26ffd0627c52e Reviewed-on: https://gerrit.libreoffice.org/68402 Tested-by: Jenkins Reviewed-by: Michael Stahl <[email protected]> (cherry picked from commit b7d4418c309c8bc4fd25485dd3a0ea6ad9edf34e) Reviewed-on: https://gerrit.libreoffice.org/68677 Reviewed-by: Thorsten Behrens <[email protected]> (cherry picked from commit a551d277dc07fc0fbb3d58fd66c0686fe531126b) Reviewed-on: https://gerrit.libreoffice.org/69187 Tested-by: Thorsten Behrens <[email protected]> diff --git a/sw/source/core/text/txtfrm.cxx b/sw/source/core/text/txtfrm.cxx index 55190d2a75c4..9f7674c2ba27 100644 --- a/sw/source/core/text/txtfrm.cxx +++ b/sw/source/core/text/txtfrm.cxx @@ -2552,7 +2552,6 @@ void SwTextFrame::PrepWidows( const sal_uInt16 nNeed, bool bNotify ) SwParaPortion *pPara = GetPara(); if ( !pPara ) return; - pPara->SetPrepWidows(); sal_uInt16 nHave = nNeed; @@ -2584,6 +2583,7 @@ void SwTextFrame::PrepWidows( const sal_uInt16 nNeed, bool bNotify ) if( bSplit ) { + pPara->SetPrepWidows(); GetFollow()->SetOfst( aLine.GetEnd() ); aLine.TruncLines( true ); if( pPara->IsFollowField() ) diff --git a/sw/source/core/text/widorp.cxx b/sw/source/core/text/widorp.cxx index b87396701d8d..8f400c3cbf9c 100644 --- a/sw/source/core/text/widorp.cxx +++ b/sw/source/core/text/widorp.cxx @@ -460,6 +460,7 @@ bool WidowsAndOrphans::FindWidows( SwTextFrame *pFrame, SwTextMargin &rLine ) // i#91421 if ( !pMaster->GetIndPrev() ) { + pMaster->ChgThisLines(); sal_uLong nLines = pMaster->GetThisLines(); if(nLines == 0 && pMaster->HasPara()) { _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
