summaryrefslogtreecommitdiff
path: root/indra/newview/llstylemap.cpp
diff options
context:
space:
mode:
authorJames Cook <james@lindenlab.com>2008-04-30 23:30:09 +0000
committerJames Cook <james@lindenlab.com>2008-04-30 23:30:09 +0000
commit36fccc3888c5dc318a8a235da8a5cae4faeb637d (patch)
tree021e439fe9fa3a285062d70bf0b8c0f799471681 /indra/newview/llstylemap.cpp
parentcf2a96375f62316b98c2dddd57f812f7565584be (diff)
svn merge -r 86190:86191 maint-ui-11-merge (EFFECTIVE MERGE: -r 84579:85724 maint-ui-11-qa).
Diffstat (limited to 'indra/newview/llstylemap.cpp')
-rw-r--r--indra/newview/llstylemap.cpp75
1 files changed, 75 insertions, 0 deletions
diff --git a/indra/newview/llstylemap.cpp b/indra/newview/llstylemap.cpp
new file mode 100644
index 0000000000..09578a011a
--- /dev/null
+++ b/indra/newview/llstylemap.cpp
@@ -0,0 +1,75 @@
+/**
+ * @file llstylemap.cpp
+ * @brief LLStyleMap class implementation
+ *
+ * $LicenseInfo:firstyear=2002&license=viewergpl$
+ *
+ * Copyright (c) 2002-2007, Linden Research, Inc.
+ *
+ * Second Life Viewer Source Code
+ * The source code in this file ("Source Code") is provided by Linden Lab
+ * to you under the terms of the GNU General Public License, version 2.0
+ * ("GPL"), unless you have obtained a separate licensing agreement
+ * ("Other License"), formally executed by you and Linden Lab. Terms of
+ * the GPL can be found in doc/GPL-license.txt in this distribution, or
+ * online at http://secondlife.com/developers/opensource/gplv2
+ *
+ * There are special exceptions to the terms and conditions of the GPL as
+ * it is applied to this Source Code. View the full text of the exception
+ * in the file doc/FLOSS-exception.txt in this software distribution, or
+ * online at http://secondlife.com/developers/opensource/flossexception
+ *
+ * By copying, modifying or distributing this software, you acknowledge
+ * that you have read and understood your obligations described above,
+ * and agree to abide by those obligations.
+ *
+ * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
+ * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
+ * COMPLETENESS OR PERFORMANCE.
+ * $/LicenseInfo$
+ */
+
+#include "llviewerprecompiledheaders.h"
+
+#include "llstylemap.h"
+#include "llstring.h"
+#include "llui.h"
+#include "llviewercontrol.h"
+#include "llagent.h"
+
+LLStyleMap::LLStyleMap()
+{
+}
+
+LLStyleMap::~LLStyleMap()
+{
+}
+
+LLStyleMap &LLStyleMap::instance()
+{
+ static LLStyleMap mStyleMap;
+ return mStyleMap;
+}
+
+// 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)
+{
+ // Find this style in the map or add it if not. This map holds links to residents' profiles.
+ if (find(source) == end())
+ {
+ LLStyleSP style(new LLStyle);
+ style->setVisible(true);
+ style->setFontName(LLString::null);
+ if (source != gAgent.getID() && source != LLUUID::null)
+ {
+ style->setColor(gSavedSettings.getColor4("HTMLLinkColor"));
+ LLString link = llformat("secondlife:///app/agent/%s/about",source.asString().c_str());
+ style->setLinkHREF(link);
+ }
+ else
+ style->setColor(LLColor4::white);
+ (*this)[source] = style;
+ }
+ return (*this)[source];
+}