Kaydet (Commit) e0e2cc7c authored tarafından Caolán McNamara's avatar Caolán McNamara

Related: tdf#93461 relax loop detection some more

have an internal RH document which has a caption on a draw
document which appears behind the drawing otherwise

Change-Id: I7c3abb3104e0125fce4fc1b575861006f166fa48
üst 81e2dbd9
...@@ -1895,18 +1895,21 @@ bool SwTextFrm::FormatQuick( bool bForceQuickFormat ) ...@@ -1895,18 +1895,21 @@ bool SwTextFrm::FormatQuick( bool bForceQuickFormat )
const sal_Int32 nEnd = GetFollow() const sal_Int32 nEnd = GetFollow()
? GetFollow()->GetOfst() : aInf.GetText().getLength(); ? GetFollow()->GetOfst() : aInf.GetText().getLength();
bool bPreviousLayoutWasZeroWidth = false; int nLoopProtection = 0;
do do
{ {
sal_Int32 nNewStart = aLine.FormatLine(nStart); sal_Int32 nNewStart = aLine.FormatLine(nStart);
bool bThisLayoutIsZeroWidth = (nNewStart == nStart); if (nNewStart == nStart)
++nLoopProtection;
else
nLoopProtection = 0;
nStart = nNewStart; nStart = nNewStart;
bool bWillEndlessInsert = (bPreviousLayoutWasZeroWidth && bThisLayoutIsZeroWidth); const bool bWillEndlessInsert = nLoopProtection > 2;
SAL_WARN_IF(bWillEndlessInsert, "sw", "loop detection triggered");
if ((!bWillEndlessInsert) // Check for special case: line is invisible, if ((!bWillEndlessInsert) // Check for special case: line is invisible,
// like in too thin table cell: tdf#66141 // like in too thin table cell: tdf#66141
&& (aInf.IsNewLine() || (!aInf.IsStop() && nStart < nEnd))) && (aInf.IsNewLine() || (!aInf.IsStop() && nStart < nEnd)))
aLine.Insert( new SwLineLayout() ); aLine.Insert( new SwLineLayout() );
bPreviousLayoutWasZeroWidth = bThisLayoutIsZeroWidth;
} while( aLine.Next() ); } while( aLine.Next() );
// Last exit: the heights need to match // Last exit: the heights need to match
......
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