Fix name lists being derpy due to an apparent parsing failure

This commit is contained in:
Lirusaito
2013-07-16 17:29:57 -04:00
parent d3d5f00453
commit fb22cfc6db

View File

@@ -365,7 +365,6 @@ LLView* LLNameListCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFacto
LLSD columns; LLSD columns;
S32 index = 0; S32 index = 0;
//S32 total_static = 0;
LLXMLNodePtr child; LLXMLNodePtr child;
for (child = node->getFirstChild(); child.notNull(); child = child->getNextSibling()) for (child = node->getFirstChild(); child.notNull(); child = child->getNextSibling())
{ {
@@ -377,21 +376,25 @@ LLView* LLNameListCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFacto
std::string columnname(labelname); std::string columnname(labelname);
child->getAttributeString("name", columnname); child->getAttributeString("name", columnname);
BOOL columndynamicwidth = FALSE;
child->getAttributeBOOL("dynamicwidth", columndynamicwidth);
std::string sortname(columnname); std::string sortname(columnname);
child->getAttributeString("sort", sortname); child->getAttributeString("sort", sortname);
S32 columnwidth = -1;
if (child->hasAttribute("relwidth")) if (child->hasAttribute("relwidth"))
{ {
F32 columnrelwidth = 0.f; F32 columnrelwidth = 0.f;
child->getAttributeF32("relwidth", columnrelwidth); child->getAttributeF32("relwidth", columnrelwidth);
columns[index]["relwidth"] = columnrelwidth; columns[index]["relwidth"] = columnrelwidth;
} }
else if (child->hasAttribute("dynamicwidth"))
{
BOOL columndynamicwidth = FALSE;
child->getAttributeBOOL("dynamicwidth", columndynamicwidth);
columns[index]["dynamic_width"] = columndynamicwidth;
}
else else
{ {
S32 columnwidth = -1;
child->getAttributeS32("width", columnwidth); child->getAttributeS32("width", columnwidth);
columns[index]["width"] = columnwidth; columns[index]["width"] = columnwidth;
} }
@@ -399,12 +402,9 @@ LLView* LLNameListCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFacto
LLFontGL::HAlign h_align = LLFontGL::LEFT; LLFontGL::HAlign h_align = LLFontGL::LEFT;
h_align = LLView::selectFontHAlign(child); h_align = LLView::selectFontHAlign(child);
//if(!columndynamicwidth) total_static += llmax(0, columnwidth);
columns[index]["name"] = columnname; columns[index]["name"] = columnname;
columns[index]["label"] = labelname; columns[index]["label"] = labelname;
columns[index]["halign"] = (S32)h_align; columns[index]["halign"] = (S32)h_align;
columns[index]["dynamicwidth"] = columndynamicwidth;
columns[index]["sort"] = sortname; columns[index]["sort"] = sortname;
index++; index++;