diff --git a/indra/llui/llscrolllistcell.cpp b/indra/llui/llscrolllistcell.cpp index 9d25c7180d..59c75c61b4 100644 --- a/indra/llui/llscrolllistcell.cpp +++ b/indra/llui/llscrolllistcell.cpp @@ -66,7 +66,8 @@ LLScrollListCell* LLScrollListCell::create(const LLScrollListCell::Params& cell_ LLScrollListCell::LLScrollListCell(const LLScrollListCell::Params& p) : mWidth(p.width), - mToolTip(p.tool_tip) + mToolTip(p.tool_tip), + mColumn(p.column) // Ansariel: Also store the column name the cell belongs to if that info is already provided {} // virtual diff --git a/indra/llui/llscrolllistcell.h b/indra/llui/llscrolllistcell.h index d625ebddcc..cd661e4da3 100644 --- a/indra/llui/llscrolllistcell.h +++ b/indra/llui/llscrolllistcell.h @@ -110,9 +110,15 @@ public: virtual BOOL handleClick() { return FALSE; } virtual void setEnabled(BOOL enable) { } + // Ansariel: Return column name the cell belongs to + virtual std::string getName() const { return mColumn; } + private: S32 mWidth; std::string mToolTip; + + // Ansariel: Column name the cell belongs to + std::string mColumn; }; class LLScrollListSpacer : public LLScrollListCell diff --git a/indra/llui/llscrolllistitem.cpp b/indra/llui/llscrolllistitem.cpp index d95752e31c..fb0ffc740a 100644 --- a/indra/llui/llscrolllistitem.cpp +++ b/indra/llui/llscrolllistitem.cpp @@ -101,6 +101,22 @@ LLScrollListCell* LLScrollListItem::getColumn(const S32 i) const return NULL; } +// Ansariel: Return LLScrollListCell by name +LLScrollListCell* LLScrollListItem::getColumn(const std::string& name) const +{ + std::vector::const_iterator it = mColumns.begin(); + + for (; it < mColumns.end(); it++) + { + if ((*it)->getName() == name) + { + return (*it); + } + } + + return NULL; +} + std::string LLScrollListItem::getContentsCSV() const { std::string ret; diff --git a/indra/llui/llscrolllistitem.h b/indra/llui/llscrolllistitem.h index 611df729b4..86d9155189 100644 --- a/indra/llui/llscrolllistitem.h +++ b/indra/llui/llscrolllistitem.h @@ -105,6 +105,9 @@ public: LLScrollListCell *getColumn(const S32 i) const; + // Ansariel: Return LLScrollListCell by name + LLScrollListCell *getColumn(const std::string& name) const; + std::string getContentsCSV() const; virtual void draw(const LLRect& rect, const LLColor4& fg_color, const LLColor4& bg_color, const LLColor4& highlight_color, S32 column_padding);