summaryrefslogtreecommitdiff
path: root/indra/llui/lllineeditor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llui/lllineeditor.cpp')
-rw-r--r--indra/llui/lllineeditor.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/indra/llui/lllineeditor.cpp b/indra/llui/lllineeditor.cpp
index b54470d44a..90e0552861 100644
--- a/indra/llui/lllineeditor.cpp
+++ b/indra/llui/lllineeditor.cpp
@@ -132,7 +132,8 @@ LLLineEditor::LLLineEditor(const LLString& name, const LLRect& rect,
mSelectAllonFocusReceived( FALSE ),
mPassDelete(FALSE),
mReadOnly(FALSE),
- mImage( sImage )
+ mImage( sImage ),
+ mReplaceNewlinesWithSpaces( TRUE )
{
llassert( max_length_bytes > 0 );
@@ -961,7 +962,7 @@ void LLLineEditor::paste()
LLWString clean_string(paste);
LLWString::replaceTabsWithSpaces(clean_string, 1);
//clean_string = wstring_detabify(paste, 1);
- LLWString::replaceChar(clean_string, '\n', ' ');
+ LLWString::replaceChar(clean_string, '\n', mReplaceNewlinesWithSpaces ? ' ' : 182); // 182 == paragraph character
// Insert the string
@@ -2547,6 +2548,10 @@ S32 LLLineEditor::getPreeditFontSize() const
return llround(mGLFont->getLineHeight() * LLUI::sGLScaleFactor.mV[VY]);
}
+void LLLineEditor::setReplaceNewlinesWithSpaces(BOOL replace)
+{
+ mReplaceNewlinesWithSpaces = replace;
+}
static LLRegisterWidget<LLSearchEditor> r2("search_editor");