Fix pasting text containing linefeeds into the chat textbox expands them to multiline although single line mode is set
parent
adb6c935d2
commit
3b401a9996
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in New Issue