From ae15e85e9f6e7b804326afa992c34c76388fc8e7 Mon Sep 17 00:00:00 2001
From: Mnikolenko ProductEngine <mnikolenko@productengine.com>
Date: Tue, 8 Jul 2014 13:07:46 +0300
Subject: MAINT-3460 FIXED Dictionary doesn't exchange the mispelled word to
 correct one in a special case

---
 indra/llui/lltextbase.cpp | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

(limited to 'indra')

diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp
index b57e858d9e..2d7062e71d 100755
--- a/indra/llui/lltextbase.cpp
+++ b/indra/llui/lltextbase.cpp
@@ -1308,14 +1308,14 @@ void LLTextBase::replaceWithSuggestion(U32 index)
 		if ( (it->first <= (U32)mCursorPos) && (it->second >= (U32)mCursorPos) )
 		{
 			deselect();
-
-			// Delete the misspelled word
-			removeStringNoUndo(it->first, it->second - it->first);
-
 			// Insert the suggestion in its place
 			LLWString suggestion = utf8str_to_wstring(mSuggestionList[index]);
 			insertStringNoUndo(it->first, utf8str_to_wstring(mSuggestionList[index]));
 
+			// Delete the misspelled word
+			removeStringNoUndo(it->first + (S32)suggestion.length(), it->second - it->first);
+
+
 			setCursorPos(it->first + (S32)suggestion.length());
 
 			break;
-- 
cgit v1.2.3