diff options
| author | Leyla Farazha <leyla@lindenlab.com> | 2010-05-26 16:24:49 -0700 |
|---|---|---|
| committer | Leyla Farazha <leyla@lindenlab.com> | 2010-05-26 16:24:49 -0700 |
| commit | c5c13a92eb62e1e9927a9685d5433c040e6ef2ce (patch) | |
| tree | 0134513ccbd15cccd193bc38772eb5147e0f4591 /indra/llui/lltextbase.cpp | |
| parent | abcdff128c85c5a1188da8e36510f249e5918899 (diff) | |
| parent | db119d86a7a930c64b022c41386d37c001555d68 (diff) | |
Merge
Diffstat (limited to 'indra/llui/lltextbase.cpp')
| -rw-r--r-- | indra/llui/lltextbase.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index 9a07712757..8fc6f16702 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; @@ -1783,7 +1794,7 @@ void LLTextBase::replaceUrl(const std::string &url, seg->setEnd(seg_start + seg_length); // if we find a link with our Url, then replace the label - if (style->isLink() && style->getLinkHREF() == url) + if (style->getLinkHREF() == url) { S32 start = seg->getStart(); S32 end = seg->getEnd(); |
