Commits

Anonymous committed 047bfc1

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/

Comments (0)

Files changed (3)

indra/llui/lltextbase.cpp

 	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),
 	mSelectionStart( 0 ),
 	mSelectionEnd( 0 ),
 	mIsSelecting( FALSE ),
+	mPlainText ( p.plain_text ),
 	mWordWrap(p.wrap),
 	mUseEllipses( p.use_ellipses ),
 	mParseHTML(p.allow_html),
 
 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));

indra/llui/lltextbase.h

 								track_end,
 								read_only,
 								allow_scroll,
+								plain_text,
 								wrap,
 								use_ellipses,
 								allow_html,
 	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);
 	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

indra/newview/llchathistory.cpp

 {
 	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);