diff options
author | Vadim Savchuk <vsavchuk@productengine.com> | 2010-08-02 19:46:42 +0300 |
---|---|---|
committer | Vadim Savchuk <vsavchuk@productengine.com> | 2010-08-02 19:46:42 +0300 |
commit | 4104ba0a3d7aabbec3bb0df1ce233bee4a22496a (patch) | |
tree | 2189b853f4dfe99435048241bda6c3959b31f695 /indra/llui/lltextbase.cpp | |
parent | 9fcfa8277b5ab6177a5ed54418c545776dea2fc5 (diff) | |
parent | 5b7031dd83bea0f3201fd45d55ef896227f399ce (diff) |
Manual merge from default branch. Resolved conflicts in indra/newview/llfloatercamera.cpp.
--HG--
branch : product-engine
Diffstat (limited to 'indra/llui/lltextbase.cpp')
-rw-r--r-- | indra/llui/lltextbase.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index 4bcf7e6980..cde08c7b19 100644 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -1495,24 +1495,32 @@ void LLTextBase::getSegmentAndOffset( S32 startpos, segment_set_t::iterator* seg LLTextBase::segment_set_t::iterator LLTextBase::getSegIterContaining(S32 index) { + static LLPointer<LLIndexSegment> index_segment = new LLIndexSegment(); + if (index > getLength()) { return mSegments.end(); } // when there are no segments, we return the end iterator, which must be checked by caller if (mSegments.size() <= 1) { return mSegments.begin(); } //FIXME: avoid operator new somehow (without running into refcount problems) - segment_set_t::iterator it = mSegments.upper_bound(new LLIndexSegment(index)); + index_segment->setStart(index); + index_segment->setEnd(index); + segment_set_t::iterator it = mSegments.upper_bound(index_segment); return it; } LLTextBase::segment_set_t::const_iterator LLTextBase::getSegIterContaining(S32 index) const { + static LLPointer<LLIndexSegment> index_segment = new LLIndexSegment(); + if (index > getLength()) { return mSegments.end(); } // when there are no segments, we return the end iterator, which must be checked by caller if (mSegments.size() <= 1) { return mSegments.begin(); } - LLTextBase::segment_set_t::const_iterator it = mSegments.upper_bound(new LLIndexSegment(index)); + index_segment->setStart(index); + index_segment->setEnd(index); + LLTextBase::segment_set_t::const_iterator it = mSegments.upper_bound(index_segment); return it; } |