summaryrefslogtreecommitdiff
path: root/indra/llui
diff options
context:
space:
mode:
authorRichard Nelson <none@none>2010-05-26 10:11:14 -0700
committerRichard Nelson <none@none>2010-05-26 10:11:14 -0700
commit74279f551b84a409af52634df4b7d78294a818dc (patch)
treec3e51640747686cb7d7748d0cdfd6bdf00460e25 /indra/llui
parent14418c197076d0eb01bb0852b8716fa966bc9d53 (diff)
parenta01de4d25feb598179daf52e3bcf81ab9d7d433a (diff)
merge
Diffstat (limited to 'indra/llui')
-rw-r--r--indra/llui/lltextbase.cpp11
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;