diff options
| author | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2010-05-27 14:31:39 -0400 |
|---|---|---|
| committer | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2010-05-27 14:31:39 -0400 |
| commit | 4fdf70d2135c7ec0cb8d8067d4f916b1c9a1dda7 (patch) | |
| tree | 466cf9f78f159065fff714f5a99247c1ba12ecd1 /indra/llui/lltextbase.cpp | |
| parent | 670e316dd78e386e5d52da3162d87e0333b29d8a (diff) | |
| parent | e5273960de222ffae32405fde8e9fd566ff72d0a (diff) | |
merge
Diffstat (limited to 'indra/llui/lltextbase.cpp')
| -rw-r--r-- | indra/llui/lltextbase.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index 390ec234d3..78a6ab1eaa 100644 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -1116,8 +1116,19 @@ void LLTextBase::reflow() updateSegments(); + S32 reflow_count = 0; while(mReflowIndex < S32_MAX) { + // we can get into an infinite loop if the document height does not monotonically increase + // with decreasing width (embedded ui elements with alternate layouts). In that case, + // we want to stop reflowing after 2 iterations. We use 2, since we need to handle the case + // of introducing a vertical scrollbar causing a reflow with less width. We should also always + // use an even number of iterations to avoid user visible oscillation of the layout + if(++reflow_count > 2) + { + lldebugs << "Breaking out of reflow due to possible infinite loop in " << getName() << llendl; + break; + } S32 start_index = mReflowIndex; mReflowIndex = S32_MAX; |
