LLTextEditor's setText and setWText shouldn't always enforce linking

This commit is contained in:
Lirusaito
2019-05-10 16:45:20 -04:00
parent e9c99089e1
commit 2a40ca6295
2 changed files with 6 additions and 6 deletions

View File

@@ -741,7 +741,7 @@ LLMenuGL* LLTextEditor::createUrlContextMenu(S32 x, S32 y, const std::string &in
return menu; return menu;
} }
void LLTextEditor::setText(const LLStringExplicit &utf8str) void LLTextEditor::setText(const LLStringExplicit &utf8str, bool force_replace_links)
{ {
// clear out the existing text and segments // clear out the existing text and segments
mWText.clear(); mWText.clear();
@@ -756,7 +756,7 @@ void LLTextEditor::setText(const LLStringExplicit &utf8str)
//LLStringUtil::removeCRLF(text); //LLStringUtil::removeCRLF(text);
// appendText modifies mCursorPos... // appendText modifies mCursorPos...
appendText(utf8str, false, false); appendText(utf8str, false, false, nullptr, force_replace_links);
// ...so move cursor to top after appending text // ...so move cursor to top after appending text
setCursorPos(0); setCursorPos(0);
@@ -766,9 +766,9 @@ void LLTextEditor::setText(const LLStringExplicit &utf8str)
mTextIsUpToDate = true; mTextIsUpToDate = true;
} }
void LLTextEditor::setWText(const LLWString& text) void LLTextEditor::setWText(const LLWString& text, bool force_replace_links)
{ {
setText(wstring_to_utf8str(text)); setText(wstring_to_utf8str(text), force_replace_links);
} }
// virtual // virtual

View File

@@ -276,8 +276,8 @@ public:
LLMenuGL* createUrlContextMenu(S32 x, S32 y, const std::string &url); // create a popup context menu for the given Url LLMenuGL* createUrlContextMenu(S32 x, S32 y, const std::string &url); // create a popup context menu for the given Url
// Non-undoable // Non-undoable
void setText(const LLStringExplicit &utf8str); void setText(const LLStringExplicit &utf8str, bool force_replace_links = true);
void setWText(const LLWString &wtext); void setWText(const LLWString &wtext, bool force_replace_links = true);
// Returns byte length limit // Returns byte length limit
S32 getMaxLength() const { return mMaxTextByteLength; } S32 getMaxLength() const { return mMaxTextByteLength; }