diff options
| author | Nyx (Neal Orman) <nyx@lindenlab.com> | 2009-12-16 12:16:24 -0500 |
|---|---|---|
| committer | Nyx (Neal Orman) <nyx@lindenlab.com> | 2009-12-16 12:16:24 -0500 |
| commit | ace0be2a7c0665e382e47aeedfcffed7410e11a9 (patch) | |
| tree | 2d437342310d52806c6b378f1046ad56d9eb6456 /indra/newview/llchathistory.cpp | |
| parent | 90bb29245cbd9626f840f1d16c351ac415f7c35e (diff) | |
| parent | 1e5f2f5d8c4264cc704c687aa1b624296b6444e2 (diff) | |
merge with avp-tip
--HG--
branch : avatar-pipeline
Diffstat (limited to 'indra/newview/llchathistory.cpp')
| -rw-r--r-- | indra/newview/llchathistory.cpp | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index efe9ea4c35..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: @@ -332,12 +334,12 @@ LLChatHistory::~LLChatHistory() { static LLUICachedControl<S32> texteditor_border ("UITextEditorBorder", 0); - LLRect old_text_rect = mTextRect; - mTextRect = mScroller->getContentWindowRect(); - mTextRect.stretch(-texteditor_border); - mTextRect.mLeft += mLeftTextPad; - mTextRect.mRight -= mRightTextPad; - if (mTextRect != old_text_rect) + LLRect old_text_rect = mVisibleTextRect; + mVisibleTextRect = mScroller->getContentWindowRect(); + mVisibleTextRect.stretch(-texteditor_border); + mVisibleTextRect.mLeft += mLeftTextPad; + mVisibleTextRect.mRight -= mRightTextPad; + if (mVisibleTextRect != old_text_rect) { needsReflow(); } @@ -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(); } |
