summaryrefslogtreecommitdiff
path: root/indra/newview/llstylemap.cpp
diff options
context:
space:
mode:
authorRichard Nelson <richard@lindenlab.com>2009-08-24 20:04:52 +0000
committerRichard Nelson <richard@lindenlab.com>2009-08-24 20:04:52 +0000
commit138bf1132262c479dbbd5c95195db46b1efd065f (patch)
treebe2286f245865008b4ca6d738194133542822d65 /indra/newview/llstylemap.cpp
parentc2619694fd2f94ad7da2d6e936494f4c16601212 (diff)
merge -r 130399-131510 skinning-21 -> viewer-2.0.0-3
DEV-11254 DEV-11254 DEV-2003: DEV-21567 DEV-37301 EXT-104 EXT-138 EXT-217 EXT-256 EXT-259 EXT-259 EXT-328 EXT-348 EXT-386 EXT-399 EXT-403 EXT-460 EXT-492 EXT-492 EXT-531 EXT-537 EXT-684 improved text editor (handles multiple fonts simultaneously as well as inline widgets)
Diffstat (limited to 'indra/newview/llstylemap.cpp')
-rw-r--r--indra/newview/llstylemap.cpp74
1 files changed, 22 insertions, 52 deletions
diff --git a/indra/newview/llstylemap.cpp b/indra/newview/llstylemap.cpp
index a422db1cc1..fc125dcf9c 100644
--- a/indra/newview/llstylemap.cpp
+++ b/indra/newview/llstylemap.cpp
@@ -38,83 +38,53 @@
#include "llviewercontrol.h"
#include "llagent.h"
-LLStyleMap::LLStyleMap()
-{
-}
-
-LLStyleMap::~LLStyleMap()
-{
-}
-
-LLStyleMap &LLStyleMap::instance()
-{
- 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::lookupAgent(const LLUUID &source)
+const LLStyle::Params &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())
+ if (mMap.find(source) == mMap.end())
{
- LLStyleSP style(new LLStyle);
- style->setVisible(true);
- style->setFontName(LLStringUtil::null);
+ LLStyle::Params style_params;
if (source != LLUUID::null && source != gAgent.getID() )
{
- style->setColor(LLUIColorTable::instance().getColor("HTMLLinkColor"));
- std::string link = llformat("secondlife:///app/agent/%s/about",source.asString().c_str());
- style->setLinkHREF(link);
+ style_params.color.control = "HTMLLinkColor";
+ style_params.link_href = llformat("secondlife:///app/agent/%s/about",source.asString().c_str());
}
else
{
// Make the resident's own name white and don't make the name clickable.
- style->setColor(LLColor4::white);
+ style_params.color = LLColor4::white;
}
- (*this)[source] = style;
+
+ mMap[source] = LLStyle::Params();
}
- return (*this)[source];
+ return mMap[source];
}
// This is similar to lookupAgent for any generic URL encoded style.
-const LLStyleSP &LLStyleMap::lookup(const LLUUID& id, const std::string& link)
+const LLStyle::Params &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())
+ style_map_t::iterator iter = mMap.find(id);
+ if (iter == mMap.end())
{
- LLStyleSP style(new LLStyle);
- style->setVisible(true);
- style->setFontName(LLStringUtil::null);
+ LLStyle::Params style_params;
+
if (id != LLUUID::null && !link.empty())
{
- style->setColor(LLUIColorTable::instance().getColor("HTMLLinkColor"));
- style->setLinkHREF(link);
+ style_params.color.control = "HTMLLinkColor";
+ style_params.link_href = link;
}
else
- style->setColor(LLColor4::white);
- (*this)[id] = style;
+ {
+ style_params.color = LLColor4::white;
+ }
+ mMap[id] = style_params;
}
else
{
- LLStyleSP style = (*iter).second;
- if ( style->getLinkHREF() != link )
- {
- style->setLinkHREF(link);
- }
+ iter->second.link_href = link;
}
- return (*this)[id];
+ return mMap[id];
}
-void LLStyleMap::update()
-{
- for (style_map_t::iterator iter = begin(); iter != end(); ++iter)
- {
- LLStyleSP &style = iter->second;
- // Update the link color in case it has been changed.
- style->setColor(LLUIColorTable::instance().getColor("HTMLLinkColor"));
- }
-}