summaryrefslogtreecommitdiff
path: root/indra/llui/lltransutil.cpp
diff options
context:
space:
mode:
authorNat Goodspeed <nat@lindenlab.com>2012-10-12 08:42:18 -0400
committerNat Goodspeed <nat@lindenlab.com>2012-10-12 08:42:18 -0400
commit6ca37068080e3b26e5cb163dfd874bc0e2f4c837 (patch)
tree9e669c919167fbca786124bc4e99e6ebd27eed5a /indra/llui/lltransutil.cpp
parent730d13a76a4b06e6dbdd4bd5829a90bcb98b52b3 (diff)
LLUICtrlFactory::getLayeredXMLNode() gets LLDir::ESkinConstraint.
At this point, LLUICtrlFactory::getLayeredXMLNode() is a pretty thin wrapper around LLDir::findSkinnedFilenames() and LLXMLNode::getLayeredXMLNode(). Until now, LLUICtrlFactory::getLayeredXMLNode() passed (by default) LLDir::CURRENT_SKIN to LLDir::findSkinnedFilenames(). But that meant that a caller such as LLTransUtil::parseStrings() that wants almost the same functionality, but with LLDir::ALL_SKINS instead, had to clone the logic from LLUICtrlFactory::getLayeredXMLNode(). Allowing its caller to pass the desired LLDir::ESkinConstraint enum value eliminates the need to clone its logic. Remove cloned logic from LLTransUtil::parseStrings().
Diffstat (limited to 'indra/llui/lltransutil.cpp')
-rw-r--r--indra/llui/lltransutil.cpp20
1 files changed, 6 insertions, 14 deletions
diff --git a/indra/llui/lltransutil.cpp b/indra/llui/lltransutil.cpp
index 3b7e737dea..80d079cbc8 100644
--- a/indra/llui/lltransutil.cpp
+++ b/indra/llui/lltransutil.cpp
@@ -35,21 +35,13 @@
bool LLTransUtil::parseStrings(const std::string& xml_filename, const std::set<std::string>& default_args)
{
- // LLUICtrlFactory::getLayeredXMLNode() just calls
- // gDirUtilp->findSkinnedFilenames(constraint=LLDir::CURRENT_SKIN) and
- // then passes the resulting paths to LLXMLNode::getLayeredXMLNode().
- // Bypass that and call LLXMLNode::getLayeredXMLNode() directly: we want
- // constraint=LLDir::ALL_SKINS.
- std::vector<std::string> paths =
- gDirUtilp->findSkinnedFilenames(LLDir::XUI, xml_filename, LLDir::ALL_SKINS);
- if (paths.empty())
- {
- // xml_filename not found at all in any skin -- check whether entire
- // path was passed (but I hope we no longer have callers who do that)
- paths.push_back(xml_filename);
- }
LLXMLNodePtr root;
- bool success = LLXMLNode::getLayeredXMLNode(root, paths);
+ // Pass LLDir::ALL_SKINS to load a composite of all the individual string
+ // definitions in the default skin and the current skin. This means an
+ // individual skin can provide an xml_filename that overrides only a
+ // subset of the available string definitions; any string definition not
+ // overridden by that skin will be sought in the default skin.
+ bool success = LLUICtrlFactory::getLayeredXMLNode(xml_filename, root, LLDir::ALL_SKINS);
if (!success)
{
llerrs << "Couldn't load string table " << xml_filename << llendl;