summaryrefslogtreecommitdiff
path: root/indra/llui/lltextbase.cpp
diff options
context:
space:
mode:
authorOz Linden <oz@lindenlab.com>2013-03-28 10:12:18 -0400
committerOz Linden <oz@lindenlab.com>2013-03-28 10:12:18 -0400
commit130e4e510198147664a2377b62b22d8e42f00f04 (patch)
tree14556a65468e06edcbf6f68c4b026fea16fcd070 /indra/llui/lltextbase.cpp
parent515f0e5a559ff3f0cb7d02e1d40b0f71425800ea (diff)
parentcf1747712b154b6984cf374cf9c86f68a1210fb3 (diff)
merge changes for 3.5.0-beta6
Diffstat (limited to 'indra/llui/lltextbase.cpp')
-rw-r--r--indra/llui/lltextbase.cpp18
1 files changed, 17 insertions, 1 deletions
diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp
index ebc9ee244e..270d5294f9 100644
--- a/indra/llui/lltextbase.cpp
+++ b/indra/llui/lltextbase.cpp
@@ -3201,7 +3201,23 @@ S32 LLNormalTextSegment::getNumChars(S32 num_pixels, S32 segment_offset, S32 lin
LLFontGL::EWordWrapStyle word_wrap_style = (line_offset == 0)
? LLFontGL::WORD_BOUNDARY_IF_POSSIBLE
: LLFontGL::ONLY_WORD_BOUNDARIES;
- S32 num_chars = mStyle->getFont()->maxDrawableChars(text.c_str() + segment_offset + mStart,
+
+
+ LLWString offsetString(text.c_str() + segment_offset + mStart);
+
+ if(getLength() < segment_offset + mStart)
+ {
+ llerrs << "getLength() < segment_offset + mStart\t getLength()\t" << getLength() << "\tsegment_offset:\t"
+ << segment_offset << "\tmStart:\t" << mStart << "\tsegments\t" << mEditor.mSegments.size() << "\tmax_chars\t" << max_chars << llendl;
+ }
+
+ if(offsetString.length() + 1 < max_chars)
+ {
+ llerrs << "offsetString.length() + 1 < max_chars\t max_chars:\t" << max_chars << "\toffsetString.length():\t" << offsetString.length()
+ << getLength() << "\tsegment_offset:\t" << segment_offset << "\tmStart:\t" << mStart << "\tsegments\t" << mEditor.mSegments.size() << llendl;
+ }
+
+ S32 num_chars = mStyle->getFont()->maxDrawableChars(offsetString.c_str(),
(F32)num_pixels,
max_chars,
word_wrap_style);