diff options
Diffstat (limited to 'indra/llui/lluictrlfactory.h')
-rw-r--r-- | indra/llui/lluictrlfactory.h | 30 |
1 files changed, 25 insertions, 5 deletions
diff --git a/indra/llui/lluictrlfactory.h b/indra/llui/lluictrlfactory.h index 6dab9521bb..422a926e49 100644 --- a/indra/llui/lluictrlfactory.h +++ b/indra/llui/lluictrlfactory.h @@ -196,12 +196,12 @@ public: } { LLFastTimer timer(FTM_INIT_FROM_PARAMS); - widget->initFromParams(params); + widget->initFromParams(params); } if (parent) { - S32 tab_group = params.tab_group.isProvided() ? params.tab_group() : parent->getLastTabGroup(); + S32 tab_group = params.tab_group.isProvided() ? params.tab_group() : S32_MAX; setCtrlParent(widget, parent, tab_group); } return widget; @@ -220,7 +220,7 @@ public: return widget; } - + LLView* createFromXML(LLXMLNodePtr node, LLView* parent, const std::string& filename, const widget_registry_t&, LLXMLNodePtr output_node ); template<typename T> @@ -309,9 +309,29 @@ fail: // Apply layout transformations, usually munging rect T::setupParams(params, parent); - T* widget = createWidget<T>(params, parent); + if (!params.validateBlock()) + { + llwarns << getInstance()->getCurFileName() << ": Invalid parameter block for " << typeid(T).name() << llendl; + } + T* widget; + { + LLFastTimer timer(FTM_WIDGET_CONSTRUCTION); + widget = new T(params); + } + { + LLFastTimer timer(FTM_INIT_FROM_PARAMS); + widget->initFromParams(params); + } + + if (parent) + { + S32 tab_group = params.tab_group.isProvided() ? params.tab_group() : -1; + setCtrlParent(widget, parent, tab_group); + } + + typedef typename T::child_registry_t registry_t; - createChildren(widget, node, typename T::child_registry_t::instance(), output_node); + createChildren(widget, node, registry_t::instance(), output_node); if (widget && !widget->postBuild()) { |