diff options
author | dolphin <dolphin@lindenlab.com> | 2014-06-17 13:09:15 -0700 |
---|---|---|
committer | dolphin <dolphin@lindenlab.com> | 2014-06-17 13:09:15 -0700 |
commit | 299921de323eb9b6844cd7b6f6b8da3490ee3747 (patch) | |
tree | dcb4c5c257622c20014a0b986dc8e2d1c25a10c7 /indra/llinventory/llinventory.cpp | |
parent | 89ea1cbc7acee8878c36a5795dd3df12a913c513 (diff) | |
parent | 977476171ddcc057d7c28b6c14ae988b8189ed75 (diff) |
Merge with 3.7.9-release
Diffstat (limited to 'indra/llinventory/llinventory.cpp')
-rwxr-xr-x | indra/llinventory/llinventory.cpp | 35 |
1 files changed, 22 insertions, 13 deletions
diff --git a/indra/llinventory/llinventory.cpp b/indra/llinventory/llinventory.cpp index 7fb2a801b2..11647c5518 100755 --- a/indra/llinventory/llinventory.cpp +++ b/indra/llinventory/llinventory.cpp @@ -51,6 +51,7 @@ static const std::string INV_DESC_LABEL("desc"); static const std::string INV_PERMISSIONS_LABEL("permissions"); static const std::string INV_SHADOW_ID_LABEL("shadow_id"); static const std::string INV_ASSET_ID_LABEL("asset_id"); +static const std::string INV_LINKED_ID_LABEL("linked_id"); static const std::string INV_SALE_INFO_LABEL("sale_info"); static const std::string INV_FLAGS_LABEL("flags"); static const std::string INV_CREATION_DATE_LABEL("created_at"); @@ -257,13 +258,6 @@ BOOL LLInventoryObject::exportLegacyStream(std::ostream& output_stream, BOOL) co return TRUE; } - -void LLInventoryObject::removeFromServer() -{ - // don't do nothin' - LL_WARNS() << "LLInventoryObject::removeFromServer() called. Doesn't do anything." << LL_ENDL; -} - void LLInventoryObject::updateParentOnServer(BOOL) const { // don't do nothin' @@ -276,7 +270,7 @@ void LLInventoryObject::updateServer(BOOL) const LL_WARNS() << "LLInventoryObject::updateServer() called. Doesn't do anything." << LL_ENDL; } -inline +// static void LLInventoryObject::correctInventoryName(std::string& name) { LLStringUtil::replaceNonstandardASCII(name, ' '); @@ -435,12 +429,17 @@ U32 LLInventoryItem::getCRC32() const return crc; } +// static +void LLInventoryItem::correctInventoryDescription(std::string& desc) +{ + LLStringUtil::replaceNonstandardASCII(desc, ' '); + LLStringUtil::replaceChar(desc, '|', ' '); +} void LLInventoryItem::setDescription(const std::string& d) { std::string new_desc(d); - LLStringUtil::replaceNonstandardASCII(new_desc, ' '); - LLStringUtil::replaceChar(new_desc, '|', ' '); + LLInventoryItem::correctInventoryDescription(new_desc); if( new_desc != mDescription ) { disclaimMem(mDescription); @@ -1068,11 +1067,16 @@ void LLInventoryItem::asLLSD( LLSD& sd ) const LLTrace::BlockTimerStatHandle FTM_INVENTORY_SD_DESERIALIZE("Inventory SD Deserialize"); -bool LLInventoryItem::fromLLSD(const LLSD& sd) +bool LLInventoryItem::fromLLSD(const LLSD& sd, bool is_new) { LL_RECORD_BLOCK_TIME(FTM_INVENTORY_SD_DESERIALIZE); - mInventoryType = LLInventoryType::IT_NONE; - mAssetUUID.setNull(); + if (is_new) + { + // If we're adding LLSD to an existing object, need avoid + // clobbering these fields. + mInventoryType = LLInventoryType::IT_NONE; + mAssetUUID.setNull(); + } std::string w; w = INV_ITEM_ID_LABEL; @@ -1129,6 +1133,11 @@ bool LLInventoryItem::fromLLSD(const LLSD& sd) { mAssetUUID = sd[w]; } + w = INV_LINKED_ID_LABEL; + if (sd.has(w)) + { + mAssetUUID = sd[w]; + } w = INV_ASSET_TYPE_LABEL; if (sd.has(w)) { |