summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-09-29 21:05:58 +0100
committerCaolán McNamara <caolanm@redhat.com>2015-09-29 21:07:48 +0100
commite0e2cc7ca6d498b3e696bbc306d3f1e403ebf27d (patch)
treeb2dd2184b53a58776297b6a368daf12f7cef30d6
parent81e2dbd9b5615d57c1737aeff3f083d48a71405b (diff)
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
-rw-r--r--sw/source/core/text/frmform.cxx11
1 files changed, 7 insertions, 4 deletions
diff --git a/sw/source/core/text/frmform.cxx b/sw/source/core/text/frmform.cxx
index b9a037775595..7d3c623badfd 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