summaryrefslogtreecommitdiff
path: root/indra/llui/lltexteditor.cpp
diff options
context:
space:
mode:
authorDon Kjer <don@lindenlab.com>2007-05-02 21:24:47 +0000
committerDon Kjer <don@lindenlab.com>2007-05-02 21:24:47 +0000
commit1c909afe3998778e4cc045c9ab733e8afbf7c25b (patch)
tree75c00a32a8e305280cbec253195d1113d628fc3e /indra/llui/lltexteditor.cpp
parentbc59c04653bf1404e8148a8169208b146a123b28 (diff)
svn merge -r 60342:61148 svn+ssh://svn/svn/linden/branches/maintenance into release
Diffstat (limited to 'indra/llui/lltexteditor.cpp')
-rw-r--r--indra/llui/lltexteditor.cpp20
1 files changed, 14 insertions, 6 deletions
diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp
index 651a421742..2b588cacce 100644
--- a/indra/llui/lltexteditor.cpp
+++ b/indra/llui/lltexteditor.cpp
@@ -703,11 +703,11 @@ S32 LLTextEditor::prevWordPos(S32 cursorPos) const
S32 LLTextEditor::nextWordPos(S32 cursorPos) const
{
const LLWString& wtext = mWText;
- while( (cursorPos < getLength()) && isPartOfWord( wtext[cursorPos+1] ) )
+ while( (cursorPos < getLength()) && isPartOfWord( wtext[cursorPos] ) )
{
cursorPos++;
}
- while( (cursorPos < getLength()) && (wtext[cursorPos+1] == ' ') )
+ while( (cursorPos < getLength()) && (wtext[cursorPos] == ' ') )
{
cursorPos++;
}
@@ -3647,10 +3647,18 @@ void LLTextEditor::pruneSegments()
break; // done
}
}
- // erase invalid segments
- ++iter;
- std::for_each(iter, mSegments.end(), DeletePointer());
- mSegments.erase(iter, mSegments.end());
+ if (iter != mSegments.end())
+ {
+ // erase invalid segments
+ ++iter;
+ std::for_each(iter, mSegments.end(), DeletePointer());
+ mSegments.erase(iter, mSegments.end());
+ }
+ else
+ {
+ llwarns << "Tried to erase end of empty LLTextEditor"
+ << llendl;
+ }
}
void LLTextEditor::findEmbeddedItemSegments()