summaryrefslogtreecommitdiff
path: root/indra/llui/lltextbase.cpp
diff options
context:
space:
mode:
authorprep@lindenlab.com <prep@lindenlab.com>2013-03-29 10:37:58 -0500
committerprep@lindenlab.com <prep@lindenlab.com>2013-03-29 10:37:58 -0500
commit0f24668b0a834e37a3a8767abc7b0ee51bf23fcd (patch)
tree4ae685f79c3964e1ac7246641fa9d957b25b5ee1 /indra/llui/lltextbase.cpp
parent8e6d2f8ddc3fe8a1eee3abe99eb5abd3575c5841 (diff)
parenta62a824efb89aff3056d0659ee2c23ad6d15eeaa (diff)
Merged in Chui beta6+ fixes
Diffstat (limited to 'indra/llui/lltextbase.cpp')
-rw-r--r--indra/llui/lltextbase.cpp22
1 files changed, 21 insertions, 1 deletions
diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp
index 409f1c7f10..e70992129a 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);
@@ -3474,3 +3490,7 @@ F32 LLImageTextSegment::draw(S32 start, S32 end, S32 selection_start, S32 select
return 0.0;
}
+void LLTextBase::setWordWrap(bool wrap)
+{
+ mWordWrap = wrap;
+}