From a4617ca0ea7b0125ca20e732027a0bc3f6f394ed Mon Sep 17 00:00:00 2001 From: Leyla Farazha Date: Wed, 29 Sep 2010 16:17:35 -0700 Subject: DN-114 Paste function into text boxes not working in Viewer --- indra/llui/lllineeditor.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'indra') 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(); -- cgit v1.2.3