CHUI-739 Fixed! FUI toolbars not displayed when switching between CHUI and release viewer : parsing declare values of Enums
parent
b0c8a20172
commit
254e288d95
|
|
@ -254,14 +254,30 @@ namespace LLInitParam
|
|||
{
|
||||
static bool read(T& param, Parser* parser)
|
||||
{
|
||||
// read all enums as ints
|
||||
std::string value_string;
|
||||
//TypeValues<T>::value_t v;
|
||||
|
||||
// trying to get the declare value
|
||||
parser_read_func_map_t::iterator string_func = parser->mParserReadFuncs->find(&typeid(std::string));
|
||||
if (string_func != parser->mParserReadFuncs->end())
|
||||
{
|
||||
if (string_func->second(*parser, (void*)&value_string))
|
||||
{
|
||||
if (TypeValues<T>::getValueFromName(value_string, param))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// read enums as ints if it not declared as string
|
||||
parser_read_func_map_t::iterator found_it = parser->mParserReadFuncs->find(&typeid(S32));
|
||||
if (found_it != parser->mParserReadFuncs->end())
|
||||
{
|
||||
S32 value;
|
||||
if (found_it->second(*parser, (void*)&value))
|
||||
S32 value_S32;
|
||||
if (found_it->second(*parser, (void*)&value_S32))
|
||||
{
|
||||
param = (T)value;
|
||||
param = (T)value_S32;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -260,8 +260,9 @@ bool LLToolBarView::loadToolbars(bool force_default)
|
|||
LLXUIParser parser;
|
||||
if (!err)
|
||||
{
|
||||
parser.readXUI(root, toolbar_set, toolbar_file);
|
||||
parser.readXUI(root, toolbar_set, toolbar_file);
|
||||
}
|
||||
|
||||
if (!err && !toolbar_set.validateBlock())
|
||||
{
|
||||
llwarns << "Unable to validate toolbars from file: " << toolbar_file << llendl;
|
||||
|
|
@ -273,8 +274,9 @@ bool LLToolBarView::loadToolbars(bool force_default)
|
|||
if (force_default)
|
||||
{
|
||||
llerrs << "Unable to load toolbars from default file : " << toolbar_file << llendl;
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// Try to load the default toolbars
|
||||
return loadToolbars(true);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue