From 0c8f2f1ea0d7ab1f6289ced746f81fc920d6f37d Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Fri, 18 Jan 2019 02:14:31 -0500 Subject: [PATCH] Cleanup and add back an opt in text editor --- indra/llui/lltexteditor.cpp | 11 ++++++++--- indra/llui/lltexteditor.h | 3 --- indra/newview/llprefschat.cpp | 1 - indra/newview/llstartup.cpp | 3 --- 4 files changed, 8 insertions(+), 10 deletions(-) diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp index 03b04618c..367201bcb 100644 --- a/indra/llui/lltexteditor.cpp +++ b/indra/llui/lltexteditor.cpp @@ -96,9 +96,6 @@ const S32 PREEDIT_STANDOUT_GAP = 1; const S32 PREEDIT_STANDOUT_POSITION = 2; const S32 PREEDIT_STANDOUT_THICKNESS = 2; - -LLColor4 LLTextEditor::mLinkColor = LLColor4::blue; - /////////////////////////////////////////////////////////////////// class LLTextEditor::LLTextCmdInsert : public LLTextEditor::LLTextCmd @@ -670,6 +667,9 @@ void LLTextEditor::setText(const LLStringExplicit &utf8str) setCursorPos(0); resetDirty(); + + mUTF8Text = text; + mTextIsUpToDate = true; } void LLTextEditor::setWText(const LLWString& text) @@ -4672,6 +4672,11 @@ void LLTextEditor::updateSegments() } } + updateTextSegments(); +} + +void LLTextEditor::updateTextSegments() +{ LL_RECORD_BLOCK_TIME(FTM_UPDATE_TEXT_SEGMENTS); // Make sure we have at least one segment if (mSegments.size() == 1 && mSegments[0]->getIsDefault()) diff --git a/indra/llui/lltexteditor.h b/indra/llui/lltexteditor.h index 2244b4c19..6e6bce7ee 100644 --- a/indra/llui/lltexteditor.h +++ b/indra/llui/lltexteditor.h @@ -260,8 +260,6 @@ public: void setHandleEditKeysDirectly( BOOL b ) { mHandleEditKeysDirectly = b; } - // Callbacks - static void setLinkColor(LLColor4 color) { mLinkColor = color; } void setOnScrollEndCallback(void (*callback)(void*), void* userdata); @@ -506,7 +504,6 @@ private: // Data // LLKeywords mKeywords; - static LLColor4 mLinkColor; // Concrete LLTextCmd sub-classes used by the LLTextEditor base class class LLTextCmdInsert; diff --git a/indra/newview/llprefschat.cpp b/indra/newview/llprefschat.cpp index f62a4d4e9..f76df1679 100644 --- a/indra/newview/llprefschat.cpp +++ b/indra/newview/llprefschat.cpp @@ -179,7 +179,6 @@ void LLPrefsChatImpl::apply() gSavedSettings.setColor4("BackgroundChatColor", childGetValue("background")); gSavedSettings.setColor4("HTMLLinkColor", childGetValue("links")); - LLTextEditor::setLinkColor(childGetValue("links")); gSavedSettings.setBOOL("ArrowKeysMoveAvatar", childGetValue("arrow_keys_move_avatar_check")); gSavedSettings.setBOOL("ChatShowTimestamps", childGetValue("show_timestamps_check")); diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index ea17267b9..88da7fc15 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -1132,9 +1132,6 @@ bool idle_startup() //LLPanelLogin::close(); } - //For HTML parsing in text boxes. - LLTextEditor::setLinkColor( gSavedSettings.getColor4("HTMLLinkColor") ); - // Load URL History File LLURLHistory::loadFile("url_history.xml"); // Load media plugin cookies