DN-114 Paste function into text boxes not working in Viewer

meow-7.2.2
Leyla Farazha 2010-09-29 16:17:35 -07:00
parent 68d769ae8e
commit a4617ca0ea
1 changed files with 10 additions and 5 deletions

View File

@ -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();