Fix pasting text containing linefeeds into the chat textbox expands them to multiline although single line mode is set

master
Ansariel 2015-07-10 15:10:00 +02:00
parent adb6c935d2
commit 3b401a9996
2 changed files with 21 additions and 0 deletions

View File

@ -268,3 +268,21 @@ void LLChatEntry::enableSingleLineMode(bool single_line_mode)
mPrevLinesCount = -1;
setWordWrap(!single_line_mode);
}
// <FS:Ansariel> Fix linefeed pasting
//virtual
void LLChatEntry::paste()
{
LLTextEditor::paste();
if (mSingleLineMode)
{
S32 cursor_pos = getCursorPos();
LLWString content = getWText();
LLWStringUtil::replaceChar(content, '\n', 182);
setWText(content);
setCursorPos(cursor_pos);
}
}
// </FS:Ansariel>

View File

@ -71,6 +71,9 @@ public:
// <FS:Ansariel> Changed to public so we can update history when using modifier keys
void updateHistory();
// <FS:Ansariel> Fix linefeed pasting
/*virtual*/ void paste();
private:
/**