diff options
Diffstat (limited to 'linden/indra/newview/llstylemap.cpp')
-rw-r--r-- | linden/indra/newview/llstylemap.cpp | 37 |
1 files changed, 34 insertions, 3 deletions
diff --git a/linden/indra/newview/llstylemap.cpp b/linden/indra/newview/llstylemap.cpp index 6a3415f..e3bd3cd 100644 --- a/linden/indra/newview/llstylemap.cpp +++ b/linden/indra/newview/llstylemap.cpp | |||
@@ -47,13 +47,13 @@ LLStyleMap::~LLStyleMap() | |||
47 | 47 | ||
48 | LLStyleMap &LLStyleMap::instance() | 48 | LLStyleMap &LLStyleMap::instance() |
49 | { | 49 | { |
50 | static LLStyleMap mStyleMap; | 50 | static LLStyleMap style_map; |
51 | return mStyleMap; | 51 | return style_map; |
52 | } | 52 | } |
53 | 53 | ||
54 | // This is similar to the [] accessor except that if the entry doesn't already exist, | 54 | // This is similar to the [] accessor except that if the entry doesn't already exist, |
55 | // then this will create the entry. | 55 | // then this will create the entry. |
56 | const LLStyleSP &LLStyleMap::lookup(const LLUUID &source) | 56 | const LLStyleSP &LLStyleMap::lookupAgent(const LLUUID &source) |
57 | { | 57 | { |
58 | // Find this style in the map or add it if not. This map holds links to residents' profiles. | 58 | // Find this style in the map or add it if not. This map holds links to residents' profiles. |
59 | if (find(source) == end()) | 59 | if (find(source) == end()) |
@@ -77,6 +77,37 @@ const LLStyleSP &LLStyleMap::lookup(const LLUUID &source) | |||
77 | return (*this)[source]; | 77 | return (*this)[source]; |
78 | } | 78 | } |
79 | 79 | ||
80 | // This is similar to lookupAgent for any generic URL encoded style. | ||
81 | const LLStyleSP &LLStyleMap::lookup(const LLUUID& id, const std::string& link) | ||
82 | { | ||
83 | // Find this style in the map or add it if not. | ||
84 | iterator iter = find(id); | ||
85 | if (iter == end()) | ||
86 | { | ||
87 | LLStyleSP style(new LLStyle); | ||
88 | style->setVisible(true); | ||
89 | style->setFontName(LLStringUtil::null); | ||
90 | if (id != LLUUID::null && !link.empty()) | ||
91 | { | ||
92 | style->setColor(gSavedSettings.getColor4("HTMLLinkColor")); | ||
93 | style->setLinkHREF(link); | ||
94 | } | ||
95 | else | ||
96 | style->setColor(LLColor4::white); | ||
97 | (*this)[id] = style; | ||
98 | } | ||
99 | else | ||
100 | { | ||
101 | LLStyleSP style = (*iter).second; | ||
102 | if ( style->getLinkHREF() != link ) | ||
103 | { | ||
104 | style->setLinkHREF(link); | ||
105 | } | ||
106 | } | ||
107 | |||
108 | return (*this)[id]; | ||
109 | } | ||
110 | |||
80 | void LLStyleMap::update() | 111 | void LLStyleMap::update() |
81 | { | 112 | { |
82 | for (style_map_t::iterator iter = begin(); iter != end(); ++iter) | 113 | for (style_map_t::iterator iter = begin(); iter != end(); ++iter) |