summaryrefslogtreecommitdiff
path: root/indra/newview/llstylemap.cpp
diff options
context:
space:
mode:
authorMelinda Green <melinda@lindenlab.com>2008-12-15 21:21:19 +0000
committerMelinda Green <melinda@lindenlab.com>2008-12-15 21:21:19 +0000
commite1d8dac25a93db837c780428a23f81cbf9109270 (patch)
treea0bcaec0cec1ba6b3ce813764650eada61fcde4f /indra/newview/llstylemap.cpp
parent9c0dbb123376608e464fcd8d1a2e288e01d78a3f (diff)
svn merge -r105329:105903 svn+ssh://svn/svn/linden/branches/featurettes/featurettes-batch4-merge
Resolving QAR-1051 Merge featurettes batch #4
Diffstat (limited to 'indra/newview/llstylemap.cpp')
-rw-r--r--indra/newview/llstylemap.cpp37
1 files changed, 34 insertions, 3 deletions
diff --git a/indra/newview/llstylemap.cpp b/indra/newview/llstylemap.cpp
index 2d3fb566e0..bc8c353de0 100644
--- a/indra/newview/llstylemap.cpp
+++ b/indra/newview/llstylemap.cpp
@@ -47,13 +47,13 @@ LLStyleMap::~LLStyleMap()
LLStyleMap &LLStyleMap::instance()
{
- static LLStyleMap mStyleMap;
- return mStyleMap;
+ static LLStyleMap style_map;
+ return style_map;
}
// This is similar to the [] accessor except that if the entry doesn't already exist,
// then this will create the entry.
-const LLStyleSP &LLStyleMap::lookup(const LLUUID &source)
+const LLStyleSP &LLStyleMap::lookupAgent(const LLUUID &source)
{
// Find this style in the map or add it if not. This map holds links to residents' profiles.
if (find(source) == end())
@@ -77,6 +77,37 @@ const LLStyleSP &LLStyleMap::lookup(const LLUUID &source)
return (*this)[source];
}
+// This is similar to lookupAgent for any generic URL encoded style.
+const LLStyleSP &LLStyleMap::lookup(const LLUUID& id, const std::string& link)
+{
+ // Find this style in the map or add it if not.
+ iterator iter = find(id);
+ if (iter == end())
+ {
+ LLStyleSP style(new LLStyle);
+ style->setVisible(true);
+ style->setFontName(LLStringUtil::null);
+ if (id != LLUUID::null && !link.empty())
+ {
+ style->setColor(gSavedSettings.getColor4("HTMLLinkColor"));
+ style->setLinkHREF(link);
+ }
+ else
+ style->setColor(LLColor4::white);
+ (*this)[id] = style;
+ }
+ else
+ {
+ LLStyleSP style = (*iter).second;
+ if ( style->getLinkHREF() != link )
+ {
+ style->setLinkHREF(link);
+ }
+ }
+
+ return (*this)[id];
+}
+
void LLStyleMap::update()
{
for (style_map_t::iterator iter = begin(); iter != end(); ++iter)