diff options
author | Steven Bennetts <steve@lindenlab.com> | 2009-10-12 08:20:00 +0000 |
---|---|---|
committer | Steven Bennetts <steve@lindenlab.com> | 2009-10-12 08:20:00 +0000 |
commit | 276e80ce367dd89d7f3b2882ff669d6b59b78c0c (patch) | |
tree | 79cc5cc69281cd89c668e3b9941cc7d92d53445f /indra/newview/llviewerinventory.cpp | |
parent | c2ddcfae49bb1b4794facd64de1c2ac62fdb5715 (diff) |
merge https://svn.aws.productengine.com/secondlife/export-from-ll/viewer-2-0@1967 https://svn.aws.productengine.com/secondlife/pe/stable-2@1971 -> viewer-2.0.0-3
* Bugs: EXT-1431 EXT-1237 EXT-1151 EXT-1165 EXT-1410 EXT-1419
* Dev: EXT-1232
Diffstat (limited to 'indra/newview/llviewerinventory.cpp')
-rw-r--r-- | indra/newview/llviewerinventory.cpp | 70 |
1 files changed, 35 insertions, 35 deletions
diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index 176e1b5499..dc53358311 100644 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -121,41 +121,6 @@ LLViewerInventoryItem::~LLViewerInventoryItem() { } -BOOL LLViewerInventoryItem::extractSortFieldAndDisplayName(S32* sortField, std::string* displayName) const -{ - using std::string; - using std::stringstream; - - const char separator = getSeparator(); - const string::size_type separatorPos = mName.find(separator, 0); - - BOOL result = FALSE; - - if (separatorPos < string::npos) - { - if (sortField) - { - /* - * The conversion from string to S32 is made this way instead of old plain - * atoi() to ensure portability. If on some other platform S32 will not be - * defined to be signed int, this conversion will still work because of - * operators overloading, but atoi() may fail. - */ - stringstream ss(mName.substr(0, separatorPos)); - ss >> *sortField; - } - - if (displayName) - { - *displayName = mName.substr(separatorPos + 1, string::npos); - } - - result = TRUE; - } - - return result; -} - void LLViewerInventoryItem::copyViewerItem(const LLViewerInventoryItem* other) { LLInventoryItem::copyItem(other); @@ -1314,6 +1279,41 @@ U32 LLViewerInventoryItem::getCRC32() const return LLInventoryItem::getCRC32(); } +BOOL LLViewerInventoryItem::extractSortFieldAndDisplayName(const std::string& name, S32* sortField, std::string* displayName) +{ + using std::string; + using std::stringstream; + + const char separator = getSeparator(); + const string::size_type separatorPos = name.find(separator, 0); + + BOOL result = FALSE; + + if (separatorPos < string::npos) + { + if (sortField) + { + /* + * The conversion from string to S32 is made this way instead of old plain + * atoi() to ensure portability. If on some other platform S32 will not be + * defined to be signed int, this conversion will still work because of + * operators overloading, but atoi() may fail. + */ + stringstream ss(name.substr(0, separatorPos)); + ss >> *sortField; + } + + if (displayName) + { + *displayName = name.substr(separatorPos + 1, string::npos); + } + + result = TRUE; + } + + return result; +} + // This returns true if the item that this item points to // doesn't exist in memory (i.e. LLInventoryModel). The baseitem // might still be in the database but just not loaded yet. |