diff options
author | Jacek Antonelli | 2009-04-30 13:04:20 -0500 |
---|---|---|
committer | Jacek Antonelli | 2009-04-30 13:07:16 -0500 |
commit | ca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e (patch) | |
tree | 8348301d0ac44a524f1819b777686bf086907d76 /linden/indra/newview/llstylemap.cpp | |
parent | Second Life viewer sources 1.22.11 (diff) | |
download | meta-impy-ca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e.zip meta-impy-ca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e.tar.gz meta-impy-ca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e.tar.bz2 meta-impy-ca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e.tar.xz |
Second Life viewer sources 1.23.0-RC
Diffstat (limited to '')
-rw-r--r-- | linden/indra/newview/llstylemap.cpp | 40 |
1 files changed, 36 insertions, 4 deletions
diff --git a/linden/indra/newview/llstylemap.cpp b/linden/indra/newview/llstylemap.cpp index 6a3415f..a34b4b8 100644 --- a/linden/indra/newview/llstylemap.cpp +++ b/linden/indra/newview/llstylemap.cpp | |||
@@ -17,7 +17,8 @@ | |||
17 | * There are special exceptions to the terms and conditions of the GPL as | 17 | * There are special exceptions to the terms and conditions of the GPL as |
18 | * it is applied to this Source Code. View the full text of the exception | 18 | * it is applied to this Source Code. View the full text of the exception |
19 | * in the file doc/FLOSS-exception.txt in this software distribution, or | 19 | * in the file doc/FLOSS-exception.txt in this software distribution, or |
20 | * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception | 20 | * online at |
21 | * http://secondlifegrid.net/programs/open_source/licensing/flossexception | ||
21 | * | 22 | * |
22 | * By copying, modifying or distributing this software, you acknowledge | 23 | * By copying, modifying or distributing this software, you acknowledge |
23 | * that you have read and understood your obligations described above, | 24 | * that you have read and understood your obligations described above, |
@@ -47,13 +48,13 @@ LLStyleMap::~LLStyleMap() | |||
47 | 48 | ||
48 | LLStyleMap &LLStyleMap::instance() | 49 | LLStyleMap &LLStyleMap::instance() |
49 | { | 50 | { |
50 | static LLStyleMap mStyleMap; | 51 | static LLStyleMap style_map; |
51 | return mStyleMap; | 52 | return style_map; |
52 | } | 53 | } |
53 | 54 | ||
54 | // This is similar to the [] accessor except that if the entry doesn't already exist, | 55 | // This is similar to the [] accessor except that if the entry doesn't already exist, |
55 | // then this will create the entry. | 56 | // then this will create the entry. |
56 | const LLStyleSP &LLStyleMap::lookup(const LLUUID &source) | 57 | const LLStyleSP &LLStyleMap::lookupAgent(const LLUUID &source) |
57 | { | 58 | { |
58 | // Find this style in the map or add it if not. This map holds links to residents' profiles. | 59 | // Find this style in the map or add it if not. This map holds links to residents' profiles. |
59 | if (find(source) == end()) | 60 | if (find(source) == end()) |
@@ -77,6 +78,37 @@ const LLStyleSP &LLStyleMap::lookup(const LLUUID &source) | |||
77 | return (*this)[source]; | 78 | return (*this)[source]; |
78 | } | 79 | } |
79 | 80 | ||
81 | // This is similar to lookupAgent for any generic URL encoded style. | ||
82 | const LLStyleSP &LLStyleMap::lookup(const LLUUID& id, const std::string& link) | ||
83 | { | ||
84 | // Find this style in the map or add it if not. | ||
85 | iterator iter = find(id); | ||
86 | if (iter == end()) | ||
87 | { | ||
88 | LLStyleSP style(new LLStyle); | ||
89 | style->setVisible(true); | ||
90 | style->setFontName(LLStringUtil::null); | ||
91 | if (id != LLUUID::null && !link.empty()) | ||
92 | { | ||
93 | style->setColor(gSavedSettings.getColor4("HTMLLinkColor")); | ||
94 | style->setLinkHREF(link); | ||
95 | } | ||
96 | else | ||
97 | style->setColor(LLColor4::white); | ||
98 | (*this)[id] = style; | ||
99 | } | ||
100 | else | ||
101 | { | ||
102 | LLStyleSP style = (*iter).second; | ||
103 | if ( style->getLinkHREF() != link ) | ||
104 | { | ||
105 | style->setLinkHREF(link); | ||
106 | } | ||
107 | } | ||
108 | |||
109 | return (*this)[id]; | ||
110 | } | ||
111 | |||
80 | void LLStyleMap::update() | 112 | void LLStyleMap::update() |
81 | { | 113 | { |
82 | for (style_map_t::iterator iter = begin(); iter != end(); ++iter) | 114 | for (style_map_t::iterator iter = begin(); iter != end(); ++iter) |