aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llui/lllineeditor.cpp
diff options
context:
space:
mode:
authorMcCabe Maxsted2011-04-13 16:19:40 -0700
committerMcCabe Maxsted2011-04-13 16:19:40 -0700
commitcf8be1ce5466f1005f89e0a49693e6450e280fa3 (patch)
tree7aee6da0537fb5aecea4bc85b9505f0c83f7d779 /linden/indra/llui/lllineeditor.cpp
parentIdentify Windows Server 2008 and 2008 R2, added Win 8 detection for future-pr... (diff)
downloadmeta-impy-cf8be1ce5466f1005f89e0a49693e6450e280fa3.zip
meta-impy-cf8be1ce5466f1005f89e0a49693e6450e280fa3.tar.gz
meta-impy-cf8be1ce5466f1005f89e0a49693e6450e280fa3.tar.bz2
meta-impy-cf8be1ce5466f1005f89e0a49693e6450e280fa3.tar.xz
Fixed crash in spellchecking when deleting selections while lagging
Diffstat (limited to '')
-rw-r--r--linden/indra/llui/lllineeditor.cpp31
1 files changed, 17 insertions, 14 deletions
diff --git a/linden/indra/llui/lllineeditor.cpp b/linden/indra/llui/lllineeditor.cpp
index 1d998be..7618985 100644
--- a/linden/indra/llui/lllineeditor.cpp
+++ b/linden/indra/llui/lllineeditor.cpp
@@ -604,21 +604,24 @@ std::vector<S32> LLLineEditor::getMisspelledWordsPositions()
604 { 604 {
605 wordEnd++; 605 wordEnd++;
606 } 606 }
607 //got a word :D
608 std::string selectedWord(std::string(text.begin(),
609 text.end()).substr(wordStart,wordEnd-wordStart));
610 607
611 if(!glggHunSpell->isSpelledRight(selectedWord)) 608 //got a word? -- MC
612 { 609 if (wordStart != wordEnd)
613 //misspelled word here, and you have just right clicked on it! 610 {
614 //get the center of this word.. 611 std::string selectedWord(std::string(text.begin(),
615 //S32 center = llround( (wordEnd-wordStart)/2 ) + wordStart; 612 text.end()).substr(wordStart,wordEnd-wordStart));
616 //turn this cursor position into a pixel pos 613
617 //center = findPixelNearestPos(center-getCursor()); 614 if(!selectedWord.empty() && !glggHunSpell->isSpelledRight(selectedWord))
615 {
616 //misspelled word here, and you have just right clicked on it!
617 //get the center of this word..
618 //S32 center = llround( (wordEnd-wordStart)/2 ) + wordStart;
619 //turn this cursor position into a pixel pos
620 //center = findPixelNearestPos(center-getCursor());
618 621
619 thePosesOfBadWords.push_back( 622 thePosesOfBadWords.push_back(wordStart);
620 wordStart); 623 thePosesOfBadWords.push_back(wordEnd);
621 thePosesOfBadWords.push_back(wordEnd); 624 }
622 } 625 }
623 } 626 }
624 wordEnd++; 627 wordEnd++;
@@ -2056,7 +2059,7 @@ void LLLineEditor::drawMisspelled(LLRect background)
2056 } 2059 }
2057 } 2060 }
2058 2061
2059 if (glggHunSpell->getSpellCheckHighlight()) 2062 if (!misspellLocations.empty() && glggHunSpell->getSpellCheckHighlight())
2060 { 2063 {
2061 for (int i =0; i<(int)misspellLocations.size(); i++) 2064 for (int i =0; i<(int)misspellLocations.size(); i++)
2062 { 2065 {