diff options
| author | Yuri Chebotarev <ychebotarev@productengine.com> | 2010-06-18 10:47:49 +0300 | 
|---|---|---|
| committer | Yuri Chebotarev <ychebotarev@productengine.com> | 2010-06-18 10:47:49 +0300 | 
| commit | 884e08b5093453eeb8697ab2bdb242b4b3ab9135 (patch) | |
| tree | 057bd6501c01c93eb8fd24789b05c1775fbade82 | |
| parent | 8cf968e00eab5ca3f81be1973cb6f52d34cc1f83 (diff) | |
EXT-6527 FIX Introduce new plain_text flag in LLTextBase and prevent image segment from being created if this flag is set.
reviewed by Richard Nelson at https://codereview.productengine.com/secondlife/r/587/
--HG--
branch : product-engine
| -rw-r--r-- | indra/llui/lltextbase.cpp | 6 | ||||
| -rw-r--r-- | indra/llui/lltextbase.h | 5 | ||||
| -rw-r--r-- | indra/newview/llchathistory.cpp | 5 | 
3 files changed, 16 insertions, 0 deletions
| diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index 3c6c7d3e82..826ac3b940 100644 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -152,6 +152,7 @@ LLTextBase::Params::Params()  	bg_writeable_color("bg_writeable_color"),  	bg_focus_color("bg_focus_color"),  	allow_scroll("allow_scroll", true), +	plain_text("plain_text",false),  	track_end("track_end", false),  	read_only("read_only", false),  	v_pad("v_pad", 0), @@ -200,6 +201,7 @@ LLTextBase::LLTextBase(const LLTextBase::Params &p)  	mSelectionStart( 0 ),  	mSelectionEnd( 0 ),  	mIsSelecting( FALSE ), +	mPlainText ( p.plain_text ),  	mWordWrap(p.wrap),  	mUseEllipses( p.use_ellipses ),  	mParseHTML(p.allow_html), @@ -1718,6 +1720,10 @@ void LLTextBase::appendLineBreakSegment(const LLStyle::Params& style_params)  void LLTextBase::appendImageSegment(S32 highlight_part, const LLStyle::Params& style_params)  { +	if(getPlainText()) +	{ +		return; +	}  	segment_vec_t segments;  	LLStyleConstSP sp(new LLStyle(style_params));  	segments.push_back(new LLImageTextSegment(sp, getLength(),*this)); diff --git a/indra/llui/lltextbase.h b/indra/llui/lltextbase.h index 89ce5cdc8e..0a1b7f9ec1 100644 --- a/indra/llui/lltextbase.h +++ b/indra/llui/lltextbase.h @@ -86,6 +86,7 @@ public:  								track_end,  								read_only,  								allow_scroll, +								plain_text,  								wrap,  								use_ellipses,  								allow_html, @@ -177,6 +178,9 @@ public:  	void					setReadOnly(bool read_only) { mReadOnly = read_only; }  	bool					getReadOnly() { return mReadOnly; } +	void					setPlainText(bool value) { mPlainText = value;} +	bool					getPlainText() const { return mPlainText; } +  	// cursor manipulation  	bool					setCursor(S32 row, S32 column);  	bool					setCursorPos(S32 cursor_pos, bool keep_cursor_offset = false); @@ -366,6 +370,7 @@ protected:  	bool						mReadOnly;  	bool						mBGVisible;			// render background?  	bool						mClipPartial;		// false if we show lines that are partially inside bounding rect +	bool						mPlainText;			// didn't use Image or Icon segments  	S32							mMaxTextByteLength;	// Maximum length mText is allowed to be in bytes  	// support widgets diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index 18c69b5130..ab97dbb695 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -557,6 +557,11 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL  {  	bool use_plain_text_chat_history = args["use_plain_text_chat_history"].asBoolean(); +	if(mEditor) +	{ +		mEditor->setPlainText(use_plain_text_chat_history); +	} +  	if (!mEditor->scrolledToEnd() && chat.mFromID != gAgent.getID() && !chat.mFromName.empty())  	{  		mUnreadChatSources.insert(chat.mFromName); | 
