diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index ede3e87868..d9a48bc924 100644 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -1301,19 +1301,23 @@ static void removeDuplicateItems(LLInventoryModel::item_array_t& items) // [SL:KB] - Patch: Appearance-WearableDuplicateAssets | Checked: 2015-06-30 (Catznip-3.7) static void removeDuplicateWearableItemsByAssetID(LLInventoryModel::item_array_t& items) { - std::set idsAsset; - items.erase(std::remove_if(items.begin(), items.end(), - [&idsAsset](const LLViewerInventoryItem* pItem) + struct is_duplicate_asset + { + bool operator()(const LLViewerInventoryItem* pItem) { if (pItem->isWearableType()) { const LLUUID& idAsset = pItem->getAssetUUID(); - if ( (idAsset.notNull()) && (idsAsset.end() != idsAsset.find(idAsset)) ) + if ( (idAsset.notNull()) && (m_idsAsset.end() != m_idsAsset.find(idAsset)) ) return true; - idsAsset.insert(idAsset); + m_idsAsset.insert(idAsset); } return false; - }), items.end()); + } + protected: + std::set m_idsAsset; + }; + items.erase(std::remove_if(items.begin(), items.end(), is_duplicate_asset()), items.end()); } // [/SL:KB] @@ -2604,8 +2608,9 @@ void LLAppearanceMgr::updateAppearanceFromCOF(bool enforce_item_restrictions, std::set pendingAttachments; if (LLAttachmentsMgr::instance().getPendingAttachments(pendingAttachments)) { - for (const LLUUID& idAttachItem : pendingAttachments) + for (std::set::const_iterator itAttachItem = pendingAttachments.begin(); itAttachItem != pendingAttachments.end(); ++itAttachItem) { + const LLUUID& idAttachItem = *itAttachItem; if ( (!gAgentAvatarp->isWearingAttachment(idAttachItem)) || (isLinkedInCOF(idAttachItem)) ) { LLAttachmentsMgr::instance().clearPendingAttachmentLink(idAttachItem); diff --git a/indra/newview/llattachmentsmgr.cpp b/indra/newview/llattachmentsmgr.cpp index 810c1d1a2f..f30e083d6d 100755 --- a/indra/newview/llattachmentsmgr.cpp +++ b/indra/newview/llattachmentsmgr.cpp @@ -322,8 +322,9 @@ void LLAttachmentsMgr::linkRecentlyArrivedAttachments() { // [SL:KB] - Patch: Appearance-SyncAttach | Checked: 2015-06-24 (Catznip-3.7) LLPointer cb = new LLRegisterAttachmentCallback(); - for (const LLUUID& idAttach : ids_to_link) + for (uuid_vec_t::const_iterator itAttach = ids_to_link.begin(); itAttach != ids_to_link.end(); ++itAttach) { + const LLUUID& idAttach = *itAttach; if (std::find(mPendingAttachLinks.begin(), mPendingAttachLinks.end(), idAttach) == mPendingAttachLinks.end()) { LLAppearanceMgr::instance().addCOFItemLink(idAttach, cb); diff --git a/indra/newview/rlvhelper.cpp b/indra/newview/rlvhelper.cpp index 983778df94..828ea25f2c 100644 --- a/indra/newview/rlvhelper.cpp +++ b/indra/newview/rlvhelper.cpp @@ -921,8 +921,8 @@ void RlvForceWear::updatePendingAttachments() if (RlvForceWear::instanceExists()) { RlvForceWear* pThis = RlvForceWear::getInstance(); - for (const pendingattachments_map_t::value_type& itAttach : pThis->m_pendingAttachments) - LLAttachmentsMgr::instance().addAttachmentRequest(itAttach.first, itAttach.second & ~ATTACHMENT_ADD, itAttach.second & ATTACHMENT_ADD); + for (pendingattachments_map_t::const_iterator itAttach = pThis->m_pendingAttachments.begin(); itAttach != pThis->m_pendingAttachments.end(); ++itAttach) + LLAttachmentsMgr::instance().addAttachmentRequest(itAttach->first, itAttach->second & ~ATTACHMENT_ADD, itAttach->second & ATTACHMENT_ADD); pThis->m_pendingAttachments.clear(); } } @@ -962,8 +962,8 @@ void RlvForceWear::done() // Wearables if (m_remWearables.size()) { - for (const LLViewerWearable* pWearable : m_remWearables) - remItems.push_back(pWearable->getItemID()); + for (std::list::const_iterator itRemWearable = m_remWearables.begin(); itRemWearable != m_remWearables.end(); ++itRemWearable) + remItems.push_back((*itRemWearable)->getItemID()); m_remWearables.clear(); } @@ -971,8 +971,8 @@ void RlvForceWear::done() if (m_remGestures.size()) { // NOTE: LLGestureMgr::deactivateGesture() will call LLAppearanceMgr::removeCOFItemLinks() for us and supply its own callback - for (const LLViewerInventoryItem* pItem : m_remGestures) - LLGestureMgr::instance().deactivateGesture(pItem->getUUID()); + for (LLInventoryModel::item_array_t::const_iterator itRemGesture = m_remGestures.begin(); itRemGesture != m_remGestures.end(); ++itRemGesture) + LLGestureMgr::instance().deactivateGesture((*itRemGesture)->getUUID()); m_remGestures.clear(); } @@ -980,8 +980,8 @@ void RlvForceWear::done() if (m_remAttachments.size()) { LLAgentWearables::userRemoveMultipleAttachments(m_remAttachments); - for (const LLViewerObject* pAttachObj : m_remAttachments) - remItems.push_back(pAttachObj->getAttachmentItemID()); + for (std::vector::const_iterator itAttachObj = m_remAttachments.begin(); itAttachObj != m_remAttachments.end(); ++itAttachObj) + remItems.push_back((*itAttachObj)->getAttachmentItemID()); m_remAttachments.clear(); } @@ -991,11 +991,12 @@ void RlvForceWear::done() // Wearables need to be split into AT_BODYPART and AT_CLOTHING for COF LLInventoryModel::item_array_t addBodyParts, addClothing; - for (addwearables_map_t::const_iterator itAddWearables = m_addWearables.cbegin(); itAddWearables != m_addWearables.cend(); ++itAddWearables) + for (addwearables_map_t::const_iterator itAddWearables = m_addWearables.begin(); itAddWearables != m_addWearables.end(); ++itAddWearables) { // NOTE: LLAppearanceMgr will filter our duplicates so no need for us to check here - for (LLViewerInventoryItem* pItem : itAddWearables->second) + for (LLInventoryModel::item_array_t::const_iterator itItem = itAddWearables->second.begin(); itItem != itAddWearables->second.end(); ++itItem) { + LLViewerInventoryItem* pItem = *itItem; if (LLAssetType::AT_BODYPART == pItem->getType()) addBodyParts.push_back(pItem); else @@ -1005,10 +1006,10 @@ void RlvForceWear::done() m_addWearables.clear(); // Until LL provides a way for updateCOF to selectively attach add/replace we have to deal with attachments ourselves - for (addattachments_map_t::const_iterator itAddAttachments = m_addAttachments.cbegin(); itAddAttachments != m_addAttachments.cend(); ++itAddAttachments) + for (addattachments_map_t::const_iterator itAddAttachments = m_addAttachments.begin(); itAddAttachments != m_addAttachments.end(); ++itAddAttachments) { - for (const LLViewerInventoryItem* pItem : itAddAttachments->second) - addPendingAttachment(pItem->getLinkedUUID(), itAddAttachments->first); + for (LLInventoryModel::item_array_t::const_iterator itItem = itAddAttachments->second.begin(); itItem != itAddAttachments->second.end(); ++itItem) + addPendingAttachment((*itItem)->getLinkedUUID(), itAddAttachments->first); } m_addAttachments.clear(); @@ -1031,8 +1032,8 @@ void RlvForceWear::done() { // Clothing items only uuid_vec_t idClothing; - for (const LLViewerInventoryItem* pItem : addClothing) - idClothing.push_back(pItem->getUUID()); + for (LLInventoryModel::item_array_t::const_iterator itItem = addClothing.begin(); itItem != addClothing.end(); ++itItem) + idClothing.push_back((*itItem)->getUUID()); LLAppearanceMgr::instance().wearItemsOnAvatar(idClothing, false, false, cb); } else if ( (!addBodyParts.empty()) || (!addClothing.empty()) || (!m_addGestures.empty()) )