summaryrefslogtreecommitdiff
path: root/indra/llui/lluictrlfactory.h
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llui/lluictrlfactory.h')
-rw-r--r--indra/llui/lluictrlfactory.h27
1 files changed, 4 insertions, 23 deletions
diff --git a/indra/llui/lluictrlfactory.h b/indra/llui/lluictrlfactory.h
index 60f5fe9e1c..6788f29ba9 100644
--- a/indra/llui/lluictrlfactory.h
+++ b/indra/llui/lluictrlfactory.h
@@ -182,11 +182,10 @@ public:
template<typename T>
static T* createWidget(typename T::Params& params, LLView* parent = NULL)
{
- // Apply layout transformations, usually munging rect
- T::setupParams(params, parent);
-
T* widget = NULL;
+ T::setupParams(params, parent);
+
if (!params.validateBlock())
{
llwarns << getInstance()->getCurFileName() << ": Invalid parameter block for " << typeid(T).name() << llendl;
@@ -309,27 +308,9 @@ fail:
output_node, output_params, &default_params);
}
+ // Apply layout transformations, usually munging rect
params.from_xui = true;
-
- 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);
- }
+ T* widget = createWidget<T>(params, parent);
typedef typename T::child_registry_t registry_t;