diff options
Diffstat (limited to 'linden/indra/llui/lltexteditor.cpp')
-rw-r--r-- | linden/indra/llui/lltexteditor.cpp | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/linden/indra/llui/lltexteditor.cpp b/linden/indra/llui/lltexteditor.cpp index 787eba5..ba991c2 100644 --- a/linden/indra/llui/lltexteditor.cpp +++ b/linden/indra/llui/lltexteditor.cpp | |||
@@ -723,11 +723,11 @@ S32 LLTextEditor::prevWordPos(S32 cursorPos) const | |||
723 | S32 LLTextEditor::nextWordPos(S32 cursorPos) const | 723 | S32 LLTextEditor::nextWordPos(S32 cursorPos) const |
724 | { | 724 | { |
725 | const LLWString& wtext = mWText; | 725 | const LLWString& wtext = mWText; |
726 | while( (cursorPos < getLength()) && isPartOfWord( wtext[cursorPos+1] ) ) | 726 | while( (cursorPos < getLength()) && isPartOfWord( wtext[cursorPos] ) ) |
727 | { | 727 | { |
728 | cursorPos++; | 728 | cursorPos++; |
729 | } | 729 | } |
730 | while( (cursorPos < getLength()) && (wtext[cursorPos+1] == ' ') ) | 730 | while( (cursorPos < getLength()) && (wtext[cursorPos] == ' ') ) |
731 | { | 731 | { |
732 | cursorPos++; | 732 | cursorPos++; |
733 | } | 733 | } |
@@ -3667,10 +3667,18 @@ void LLTextEditor::pruneSegments() | |||
3667 | break; // done | 3667 | break; // done |
3668 | } | 3668 | } |
3669 | } | 3669 | } |
3670 | // erase invalid segments | 3670 | if (iter != mSegments.end()) |
3671 | ++iter; | 3671 | { |
3672 | std::for_each(iter, mSegments.end(), DeletePointer()); | 3672 | // erase invalid segments |
3673 | mSegments.erase(iter, mSegments.end()); | 3673 | ++iter; |
3674 | std::for_each(iter, mSegments.end(), DeletePointer()); | ||
3675 | mSegments.erase(iter, mSegments.end()); | ||
3676 | } | ||
3677 | else | ||
3678 | { | ||
3679 | llwarns << "Tried to erase end of empty LLTextEditor" | ||
3680 | << llendl; | ||
3681 | } | ||
3674 | } | 3682 | } |
3675 | 3683 | ||
3676 | void LLTextEditor::findEmbeddedItemSegments() | 3684 | void LLTextEditor::findEmbeddedItemSegments() |