aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llui
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/llui')
-rw-r--r--linden/indra/llui/lltexteditor.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/linden/indra/llui/lltexteditor.cpp b/linden/indra/llui/lltexteditor.cpp
index adf0260..d59eed6 100644
--- a/linden/indra/llui/lltexteditor.cpp
+++ b/linden/indra/llui/lltexteditor.cpp
@@ -499,8 +499,9 @@ void LLTextEditor::translateText(void * data)
499 499
500 if (has_text) 500 if (has_text)
501 { 501 {
502 const std::string to_translate = wstring_to_utf8str(line->getWText().substr(start, length));
502 LLHTTPClient::ResponderPtr result = TextChatTranslationReceiver::build(toLang, line, start, length); 503 LLHTTPClient::ResponderPtr result = TextChatTranslationReceiver::build(toLang, line, start, length);
503 LLTranslate::translateMessage(result,"", toLang, line->getText().substr(start, length)); 504 LLTranslate::translateMessage(result,"", toLang, to_translate);
504 } 505 }
505} 506}
506 507
@@ -2290,8 +2291,13 @@ void LLTextEditor::translationReplace(const std::string &translation, const S32
2290 { 2291 {
2291 remove(orig_start, orig_length, FALSE); 2292 remove(orig_start, orig_length, FALSE);
2292 } 2293 }
2293 insert(pos, wtext, FALSE); 2294 S32 inserted = insert(pos, wtext, FALSE);
2294 setCursorPos(pos + wtext.length()); 2295 if (hasSelection())
2296 {
2297 mSelectionStart = llclamp(pos, 0, getLength());
2298 mSelectionEnd = llclamp(pos + inserted, mSelectionStart, getLength());
2299 }
2300 setCursorPos(pos + inserted);
2295 needsReflow(); 2301 needsReflow();
2296} 2302}
2297 2303