Add a tiny hack to support <nolink> tag
This commit is contained in:
@@ -4295,6 +4295,12 @@ void LLTextEditor::appendTextImpl(const std::string &new_text, const LLStyleSP s
|
|||||||
};
|
};
|
||||||
auto append_link = [&](const std::string& link, LLStyleSP link_style)
|
auto append_link = [&](const std::string& link, LLStyleSP link_style)
|
||||||
{
|
{
|
||||||
|
if (!link_style->isLink())
|
||||||
|
{
|
||||||
|
appendAndHighlightText(link, part, style);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (style) // Respect styling
|
if (style) // Respect styling
|
||||||
{
|
{
|
||||||
const auto& text_style = *style;
|
const auto& text_style = *style;
|
||||||
@@ -4432,7 +4438,7 @@ void LLTextEditor::appendAndHighlightText(const std::string& new_text, S32 highl
|
|||||||
std::string::size_type start = 0;
|
std::string::size_type start = 0;
|
||||||
/*std::string::size_type pos = new_text.find('\n',start);
|
/*std::string::size_type pos = new_text.find('\n',start);
|
||||||
|
|
||||||
while(pos!=-1)
|
while(pos != std::string::npos)
|
||||||
{
|
{
|
||||||
if(pos!=start)
|
if(pos!=start)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1430,8 +1430,9 @@ std::string LLUrlEntryNoLink::getLabel(const std::string &url, const LLUrlLabelC
|
|||||||
LLStyleSP LLUrlEntryNoLink::getStyle() const
|
LLStyleSP LLUrlEntryNoLink::getStyle() const
|
||||||
{
|
{
|
||||||
// Don't render as URL (i.e. no context menu or hand cursor).
|
// Don't render as URL (i.e. no context menu or hand cursor).
|
||||||
// Singu Note: What the heck? No, that's misleading!!
|
LLStyleSP style(new LLStyle());
|
||||||
return LLUrlEntryBase::getStyle();
|
style->setLinkHREF(" ");
|
||||||
|
return style;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1536,4 +1537,3 @@ std::string LLUrlEntryJira::getUrl(const std::string &url) const
|
|||||||
}
|
}
|
||||||
// </alchemy>
|
// </alchemy>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ void LLUrlMatch::setValues(U32 start, U32 end, const std::string &url, const std
|
|||||||
mTooltip = tooltip;
|
mTooltip = tooltip;
|
||||||
mIcon = icon;
|
mIcon = icon;
|
||||||
mStyle = style;
|
mStyle = style;
|
||||||
mStyle->setLinkHREF(url);
|
mStyle->setLinkHREF(mStyle->isLink() ? LLStringUtil::null : url); // Singu Note: This hack exists in lieu of no link flag
|
||||||
mMenuName = menu;
|
mMenuName = menu;
|
||||||
mLocation = location;
|
mLocation = location;
|
||||||
mID = id;
|
mID = id;
|
||||||
|
|||||||
Reference in New Issue
Block a user