summaryrefslogtreecommitdiff
path: root/indra/newview/llchathistory.cpp
diff options
context:
space:
mode:
authorEric M. Tulla (BigPapi) <tulla@lindenlab.com>2009-12-15 15:41:51 -0500
committerEric M. Tulla (BigPapi) <tulla@lindenlab.com>2009-12-15 15:41:51 -0500
commit08495d3f63e1e926e44185be07269ed40363024a (patch)
tree8e32278f96a14b36a4215e7fac16f68d072da961 /indra/newview/llchathistory.cpp
parent870d4449f5eec1c2a7e5e4627a0433846ab256aa (diff)
parent06f8017674295191d3c4400eacb36e34a167ffa5 (diff)
Merging in latest PE changes from https://hg.aws.productengine.com/secondlife/viewer-2-0/
Diffstat (limited to 'indra/newview/llchathistory.cpp')
-rw-r--r--indra/newview/llchathistory.cpp17
1 files changed, 15 insertions, 2 deletions
diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp
index 6c843e1ec3..ee60df1b4b 100644
--- a/indra/newview/llchathistory.cpp
+++ b/indra/newview/llchathistory.cpp
@@ -49,6 +49,8 @@
static LLDefaultChildRegistry::Register<LLChatHistory> r("chat_history");
+const static std::string NEW_LINE(rawstr_to_utf8("\n"));
+
class LLChatHistoryHeader: public LLPanel
{
public:
@@ -454,10 +456,21 @@ void LLChatHistory::appendMessage(const LLChat& chat, const bool use_plain_text_
if (chat.mFromName.size() > 0)
appendText(chat.mFromName + " ", TRUE, style_params);
- appendText(chat.mText.substr(4), FALSE, style_params);
+ // Ensure that message ends with NewLine, to avoid losing of new lines
+ // while copy/paste from text chat. See EXT-3263.
+ appendText(chat.mText.substr(4) + NEW_LINE, FALSE, style_params);
}
else
- appendText(chat.mText, FALSE, style_params);
+ {
+ std::string message(chat.mText);
+ if ( message.size() > 0 && !LLStringOps::isSpace(message[message.size() - 1]) )
+ {
+ // Ensure that message ends with NewLine, to avoid losing of new lines
+ // while copy/paste from text chat. See EXT-3263.
+ message += NEW_LINE;
+ }
+ appendText(message, FALSE, style_params);
+ }
blockUndo();
}