summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike <mikekaganski@hotmail.com>2015-04-27 01:27:05 +1000
committerCaolán McNamara <caolanm@redhat.com>2015-04-30 08:28:18 +0000
commit8a08f68669f9acfe98dadcca4af6519164a17000 (patch)
tree70c4ec556011391e121916fc496dcba2df69ebfd
parent3ead3ad52f9bb2f9d1d6cf8dfc73a0a25e6778ed (diff)
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/15542 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--sw/source/core/text/frmform.cxx7
1 files changed, 5 insertions, 2 deletions
diff --git a/sw/source/core/text/frmform.cxx b/sw/source/core/text/frmform.cxx
index abec38655482..7ad55d7f6eb4 100644
--- a/sw/source/core/text/frmform.cxx
+++ b/sw/source/core/text/frmform.cxx
@@ -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() );