From d64c9a343c844ad21ed88d236407251b815aea7a Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Mon, 22 Jul 2013 20:02:45 -0400 Subject: [PATCH] Fix issue of columns not sorting in ascending order by default --- indra/llui/llscrolllistctrl.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/indra/llui/llscrolllistctrl.cpp b/indra/llui/llscrolllistctrl.cpp index 6eca09c04..219fe0473 100644 --- a/indra/llui/llscrolllistctrl.cpp +++ b/indra/llui/llscrolllistctrl.cpp @@ -2616,9 +2616,17 @@ LLView* LLScrollListCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFac if (child->getAttributeString("sort", sortname)) columns[index]["sort"] = sortname; - BOOL sort_ascending = true; - if (child->getAttributeBOOL("sort_ascending", sort_ascending)) + std::string sort_direction("ascending"); + if (child->getAttributeString("sort_direction", sort_direction)) + { + columns[index]["sort_direction"] = sort_direction; + } + else // Singu Note: if a scroll list does not provide sort_direction, provide sort_ascending to sort as expected + { + bool sort_ascending = true; + child->getAttribute_bool("sort_ascending", sort_ascending); columns[index]["sort_ascending"] = sort_ascending; + } S32 columnwidth = -1; if (child->getAttributeS32("width", columnwidth))