diff options
author | Leyla Farazha <leyla@lindenlab.com> | 2010-09-29 16:17:35 -0700 |
---|---|---|
committer | Leyla Farazha <leyla@lindenlab.com> | 2010-09-29 16:17:35 -0700 |
commit | a4617ca0ea7b0125ca20e732027a0bc3f6f394ed (patch) | |
tree | 72657422ae0987beabeab933f747d8bbd6784be6 /indra/llui | |
parent | 68d769ae8e7d5ba0fbc9c04573f988f3e48e4af0 (diff) |
DN-114 Paste function into text boxes not working in Viewer
Diffstat (limited to 'indra/llui')
-rw-r--r-- | indra/llui/lllineeditor.cpp | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/indra/llui/lllineeditor.cpp b/indra/llui/lllineeditor.cpp index 48c1b9fa6b..5f5fe851bb 100644 --- a/indra/llui/lllineeditor.cpp +++ b/indra/llui/lllineeditor.cpp @@ -1134,13 +1134,18 @@ void LLLineEditor::pasteHelper(bool is_primary) LLUI::reportBadKeystroke(); } - U32 available_chars = mMaxLengthChars - mText.getWString().size(); - - if (available_chars < clean_string.size()) + if (mMaxLengthChars) { - clean_string = clean_string.substr(0, available_chars); + U32 available_chars = mMaxLengthChars - mText.getWString().size(); + + if (available_chars < clean_string.size()) + { + clean_string = clean_string.substr(0, available_chars); + } + + LLUI::reportBadKeystroke(); } - + mText.insert(getCursor(), clean_string); setCursor( getCursor() + (S32)clean_string.length() ); deselect(); |