LLTextEditor's setText and setWText shouldn't always enforce linking
This commit is contained in:
@@ -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
|
||||||
|
|||||||
@@ -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; }
|
||||||
|
|||||||
Reference in New Issue
Block a user