From 758f656100406015bc8b27284670088decbbfabb Mon Sep 17 00:00:00 2001 From: Cho Date: Wed, 13 Nov 2013 21:38:19 +0000 Subject: made Twitter status text truncate and untruncate for ACME-1183 --- indra/newview/llfloatertwitter.cpp | 11 ++++++++++- indra/newview/llfloatertwitter.h | 2 ++ 2 files changed, 12 insertions(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/llfloatertwitter.cpp b/indra/newview/llfloatertwitter.cpp index 6f8ad109c6..06d0fb5542 100644 --- a/indra/newview/llfloatertwitter.cpp +++ b/indra/newview/llfloatertwitter.cpp @@ -119,9 +119,18 @@ void LLTwitterPhotoPanel::draw() { int max_status_length = add_photo ? 100 : 140; status_text_box->setMaxTextLength(max_status_length); + if (!add_photo) + { + if (mOldStatusText.length() > status_text_box->getText().length() && status_text_box->getText() == mOldStatusText.substr(0, status_text_box->getText().length())) + { + status_text_box->setText(mOldStatusText); + } + mOldStatusText = ""; + } if (status_text_box->getText().length() > max_status_length) { - status_text_box->setText(status_text_box->getText().substr(0, max_status_length)); + mOldStatusText = status_text_box->getText(); + status_text_box->setText(mOldStatusText.substr(0, max_status_length)); } } diff --git a/indra/newview/llfloatertwitter.h b/indra/newview/llfloatertwitter.h index 12e1d41210..686e167b1f 100644 --- a/indra/newview/llfloatertwitter.h +++ b/indra/newview/llfloatertwitter.h @@ -70,6 +70,8 @@ private: LLUICtrl * mPhotoCheckbox; LLUICtrl * mPostButton; LLUICtrl* mCancelButton; + + std::string mOldStatusText; }; class LLTwitterAccountPanel : public LLPanel -- cgit v1.2.3