[Libreoffice-commits] core.git: sw/source
Caolán McNamara
caolanm at redhat.com
Tue Sep 29 13:08:17 PDT 2015
sw/source/core/text/frmform.cxx | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
New commits:
commit e0e2cc7ca6d498b3e696bbc306d3f1e403ebf27d
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Sep 29 21:05:58 2015 +0100
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
diff --git a/sw/source/core/text/frmform.cxx b/sw/source/core/text/frmform.cxx
index b9a0377..7d3c623 100644
--- a/sw/source/core/text/frmform.cxx
+++ b/sw/source/core/text/frmform.cxx
@@ -1895,18 +1895,21 @@ bool SwTextFrm::FormatQuick( bool bForceQuickFormat )
const sal_Int32 nEnd = GetFollow()
? GetFollow()->GetOfst() : aInf.GetText().getLength();
- bool bPreviousLayoutWasZeroWidth = false;
+ int nLoopProtection = 0;
do
{
sal_Int32 nNewStart = aLine.FormatLine(nStart);
- bool bThisLayoutIsZeroWidth = (nNewStart == nStart);
+ if (nNewStart == nStart)
+ ++nLoopProtection;
+ else
+ nLoopProtection = 0;
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,
// like in too thin table cell: tdf#66141
&& (aInf.IsNewLine() || (!aInf.IsStop() && nStart < nEnd)))
aLine.Insert( new SwLineLayout() );
- bPreviousLayoutWasZeroWidth = bThisLayoutIsZeroWidth;
} while( aLine.Next() );
// Last exit: the heights need to match
More information about the Libreoffice-commits
mailing list