Fix initialization order in LLScrollListCtrl: Can only set sort column after we created the actual columns

master
Ansariel 2015-11-27 18:42:50 +01:00
parent d9811f214a
commit fc31cf7a29
1 changed files with 13 additions and 5 deletions

View File

@ -280,11 +280,12 @@ LLScrollListCtrl::LLScrollListCtrl(const LLScrollListCtrl::Params& p)
addChild(LLUICtrlFactory::create<LLTextBox>(text_p));
// </FS:Ansariel>
if (p.sort_column >= 0)
{
sortByColumnIndex(p.sort_column, p.sort_ascending);
}
// <FS:Ansariel> Can only set sort column after we created the actual columns
//if (p.sort_column >= 0)
//{
// sortByColumnIndex(p.sort_column, p.sort_ascending);
//}
// </FS:Ansariel>
for (LLInitParam::ParamIterator<LLScrollListColumn::Params>::const_iterator row_it = p.contents.columns.begin();
row_it != p.contents.columns.end();
@ -296,6 +297,13 @@ LLScrollListCtrl::LLScrollListCtrl(const LLScrollListCtrl::Params& p)
mColumnInitParams.push_back(*row_it);
}
// <FS:Ansariel> Can only set sort column after we created the actual columns
if (p.sort_column >= 0)
{
sortByColumnIndex(p.sort_column, p.sort_ascending);
}
// </FS:Ansariel>
for (LLInitParam::ParamIterator<LLScrollListItem::Params>::const_iterator row_it = p.contents.rows.begin();
row_it != p.contents.rows.end();
++row_it)