Kaydet (Commit) 8a08f686 authored tarafından Mike's avatar Mike Kaydeden (comit) Caolán McNamara

tdf#66141: SwTxtFrm::FormatQuick(bool) endless loop

If a line happens to be invisible (e.g. in too thin cell of a table)
then aLine.FormatLine(nStart) returns nStart, and
aLine.Insert( new SwLineLayout() ) is executed until OOM.

Change-Id: I9b12cf2f1f3f1987cd8ce380b1d85196ffe95e5e
Reviewed-on: https://gerrit.libreoffice.org/15542Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 3ead3ad5
......@@ -1918,8 +1918,11 @@ bool SwTxtFrm::FormatQuick( bool bForceQuickFormat )
? GetFollow()->GetOfst() : aInf.GetTxt().getLength();
do
{
nStart = aLine.FormatLine( nStart );
if( aInf.IsNewLine() || (!aInf.IsStop() && nStart < nEnd) )
sal_Int32 nShift = aLine.FormatLine(nStart) - nStart;
nStart += nShift;
if ((nShift != 0) // Check for special case: line is invisible,
// like in too thin table cell: tdf#66141
&& (aInf.IsNewLine() || (!aInf.IsStop() && nStart < nEnd)))
aLine.Insert( new SwLineLayout() );
} while( aLine.Next() );
......
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