summaryrefslogtreecommitdiff
path: root/indra/newview/llautoreplace.cpp
diff options
context:
space:
mode:
authorGraham Linden <graham@lindenlab.com>2019-05-08 10:37:34 -0700
committerGraham Linden <graham@lindenlab.com>2019-05-08 10:37:34 -0700
commit65cb4b6d20b52ffebdc93e0e19f99520f6364dde (patch)
treed2b6ff74ce2d40f5de91b95fe7b5e21701d6e181 /indra/newview/llautoreplace.cpp
parentf14888b6166f91533e778e94701b74a9639ebefd (diff)
parent34322f8f37380df868703051230f2a4109602b3f (diff)
Merge 6.2.2
Diffstat (limited to 'indra/newview/llautoreplace.cpp')
-rw-r--r--indra/newview/llautoreplace.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/indra/newview/llautoreplace.cpp b/indra/newview/llautoreplace.cpp
index dd9354fe3a..0516520c56 100644
--- a/indra/newview/llautoreplace.cpp
+++ b/indra/newview/llautoreplace.cpp
@@ -68,8 +68,8 @@ void LLAutoReplace::autoreplaceCallback(S32& replacement_start, S32& replacement
word_start--; // walk word_start back to the beginning of the word
}
LL_DEBUGS("AutoReplace") << "word_start: " << word_start << " word_end: " << word_end << LL_ENDL;
- std::string str_text = std::string(input_text.begin(), input_text.end());
- std::string last_word = str_text.substr(word_start, word_end - word_start + 1);
+ LLWString old_string = input_text.substr(word_start, word_end - word_start + 1);
+ std::string last_word = wstring_to_utf8str(old_string);
std::string replacement_word(mSettings.replaceWord(last_word));
if (replacement_word != last_word)
@@ -79,9 +79,8 @@ void LLAutoReplace::autoreplaceCallback(S32& replacement_start, S32& replacement
{
// return the replacement string
replacement_start = word_start;
- replacement_length = last_word.length();
+ replacement_length = word_end - word_start + 1;
replacement_string = utf8str_to_wstring(replacement_word);
- LLWString old_string = utf8str_to_wstring(last_word);
S32 size_change = replacement_string.size() - old_string.size();
cursor_pos += size_change;
}