diff --git a/.hgtags b/.hgtags index 5d8a2556c3..dfdc850cd2 100644 --- a/.hgtags +++ b/.hgtags @@ -211,4 +211,6 @@ fc0cbb86f5bd6e7737159e35aea2c4cf9f619b62 RLVa-1.2.1 43cb7dc1804de1a25c0b2b3f0715584af1f8b470 RLVa-1.2.2 89532c8dfd5b6c29f1cb032665b44a74a52452e1 RLVa-1.3.0 7bc5039ccf0b36eafbf6ce33a52b5e26332aa04c RLVa-1.3.1 +a563f7e215c7883c1cfd20908085687a0ed96284 RLVa-1.4.0 +40644beae9c4a617504163d5c9f195dc7bfff1b4 RLVa-1.4.1 637901b23d335e4240c2c1763b45d1df71be84be FSmerge-2.8.3 diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index e25de59799..998af75f3c 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -4189,17 +4189,17 @@ class LLViewMouselook : public view_listener_t } else { - // NaCl - Rightclick-mousewheel zoom - static LLCachedControl _NACL_MLFovValues(gSavedSettings,"_NACL_MLFovValues"); - static LLCachedControl CameraAngle(gSavedSettings,"CameraAngle"); - LLVector3 vTemp=_NACL_MLFovValues; - if(vTemp.mV[2] > 0.0f) - { - vTemp.mV[1]=CameraAngle; - vTemp.mV[2]=0.0f; - gSavedSettings.setVector3("_NACL_MLFovValues",vTemp); - gSavedSettings.setF32("CameraAngle",vTemp.mV[0]); - } + // NaCl - Rightclick-mousewheel zoom + static LLCachedControl _NACL_MLFovValues(gSavedSettings,"_NACL_MLFovValues"); + static LLCachedControl CameraAngle(gSavedSettings,"CameraAngle"); + LLVector3 vTemp=_NACL_MLFovValues; + if(vTemp.mV[2] > 0.0f) + { + vTemp.mV[1]=CameraAngle; + vTemp.mV[2]=0.0f; + gSavedSettings.setVector3("_NACL_MLFovValues",vTemp); + gSavedSettings.setF32("CameraAngle",vTemp.mV[0]); + } // NaCl End gAgentCamera.changeCameraToDefault(); } diff --git a/indra/newview/rlvhelper.cpp b/indra/newview/rlvhelper.cpp index 64daa124ca..d506250701 100644 --- a/indra/newview/rlvhelper.cpp +++ b/indra/newview/rlvhelper.cpp @@ -1128,9 +1128,9 @@ std::string rlvGetFirstParenthesisedText(const std::string& strText, std::string return std::string(); const char* pstrText = strText.c_str(); idxIt = idxStart; - while ( (cntLevel > 0) && (idxIt < strText.length()) ) + while ( (cntLevel > 0) && (++idxIt < strText.length()) ) { - if ('(' == pstrText[++idxIt]) + if ('(' == pstrText[idxIt]) cntLevel++; else if (')' == pstrText[idxIt]) cntLevel--; @@ -1157,9 +1157,9 @@ std::string rlvGetLastParenthesisedText(const std::string& strText, std::string: return std::string(); const char* pstrText = strText.c_str(); idxIt = idxEnd; - while ( (cntLevel > 0) && (idxIt >= 0) ) + while ( (cntLevel > 0) && (--idxIt >= 0) && (idxIt < strText.length()) ) { - if (')' == pstrText[--idxIt]) + if (')' == pstrText[idxIt]) cntLevel++; else if ('(' == pstrText[idxIt]) cntLevel--; diff --git a/indra/newview/rlvinventory.cpp b/indra/newview/rlvinventory.cpp index 764427654a..f5e3975b33 100644 --- a/indra/newview/rlvinventory.cpp +++ b/indra/newview/rlvinventory.cpp @@ -242,7 +242,7 @@ bool RlvInventory::getPath(const uuid_vec_t& idItems, LLInventoryModel::cat_arra return (folders.count() != 0); } -// Checked: 2011-03-28 (RLVa-1.3.0g) | Modified: RLVa-1.3.0g +// Checked: 2011-10-06 (RLVa-1.4.2a) | Modified: RLVa-1.4.2a const LLUUID& RlvInventory::getSharedRootID() const { if ( (m_idRlvRoot.isNull()) && (gInventory.isInventoryUsable()) ) @@ -251,17 +251,19 @@ const LLUUID& RlvInventory::getSharedRootID() const gInventory.getDirectDescendentsOf(gInventory.getRootFolderID(), pFolders, pItems); if (pFolders) { - // NOTE: we might have multiple #RLV folders so we'll just go with the first one we come across + // NOTE: we might have multiple #RLV folders (pick the first one with sub-folders; otherwise the last one with no sub-folders) const LLViewerInventoryCategory* pFolder; for (S32 idxFolder = 0, cntFolder = pFolders->count(); idxFolder < cntFolder; idxFolder++) { if ( ((pFolder = pFolders->get(idxFolder)) != NULL) && (cstrSharedRoot == pFolder->getName()) ) { - if (!gInventory.containsObserver((RlvInventory*)this)) - gInventory.addObserver((RlvInventory*)this); m_idRlvRoot = pFolder->getUUID(); + if (getDirectDescendentsFolderCount(pFolder) > 0) + break; } } + if ( (m_idRlvRoot.notNull()) && (!gInventory.containsObserver((RlvInventory*)this)) ) + gInventory.addObserver((RlvInventory*)this); } } return m_idRlvRoot; @@ -349,8 +351,17 @@ std::string RlvInventory::getSharedPath(const LLViewerInventoryCategory* pFolder return strPath.erase(0, 1); } +// Checked: 2011-10-06 (RLVa-1.4.2a) | Added: RLVa-1.4.2a +S32 RlvInventory::getDirectDescendentsFolderCount(const LLInventoryCategory* pFolder) +{ + LLInventoryModel::cat_array_t* pFolders = NULL; LLInventoryModel::item_array_t* pItems = NULL; + if (pFolder) + gInventory.getDirectDescendentsOf(pFolder->getUUID(), pFolders, pItems); + return (pFolders) ? pFolders->size() : 0; +} + // Checked: 2009-05-26 (RLVa-0.2.0d) | Modified: RLVa-0.2.0d -S32 RlvInventory::getDirectDescendentsCount(const LLInventoryCategory* pFolder, LLAssetType::EType filterType) +S32 RlvInventory::getDirectDescendentsItemCount(const LLInventoryCategory* pFolder, LLAssetType::EType filterType) { S32 cntType = 0; if (pFolder) @@ -450,7 +461,7 @@ void RlvRenameOnWearObserver::doneIdle() // Rename the item's parent folder if it's called "New Folder", isn't directly under #RLV and contains exactly 1 object if ( (LLViewerFolderType::lookupNewCategoryName(LLFolderType::FT_NONE) == pFolder->getName()) && (pFolder->getParentUUID() != pRlvRoot->getUUID()) && - (1 == RlvInventory::getDirectDescendentsCount(pFolder, LLAssetType::AT_OBJECT)) ) + (1 == RlvInventory::getDirectDescendentsItemCount(pFolder, LLAssetType::AT_OBJECT)) ) { pFolder->rename(strFolderName); pFolder->updateServer(FALSE); @@ -661,7 +672,7 @@ bool RlvWearableItemCollector::onCollectFolder(const LLInventoryCategory* pFolde if ( (!fLinkedFolder) && (RlvInventory::isFoldedFolder(pFolder, false)) ) // Check for folder that should get folded under its parent { - if ( (!fAttach) || (1 == RlvInventory::getDirectDescendentsCount(pFolder, LLAssetType::AT_OBJECT)) ) + if ( (!fAttach) || (1 == RlvInventory::getDirectDescendentsItemCount(pFolder, LLAssetType::AT_OBJECT)) ) { // When attaching there should only be 1 attachment in it m_Folded.push_front(pFolder->getUUID()); m_FoldingMap.insert(std::pair(pFolder->getUUID(), pFolder->getParentUUID())); diff --git a/indra/newview/rlvinventory.h b/indra/newview/rlvinventory.h index 5bdaf4538e..7b08586e67 100644 --- a/indra/newview/rlvinventory.h +++ b/indra/newview/rlvinventory.h @@ -74,8 +74,10 @@ protected: * General purpose helper functions */ public: - // Returns the number of direct descendents of pFolder that have the specified type asset type - static S32 getDirectDescendentsCount(const LLInventoryCategory* pFolder, LLAssetType::EType filterType); + // Returns the number of sub-folders of the specified folder + static S32 getDirectDescendentsFolderCount(const LLInventoryCategory* pFolder); + // Returns the number of direct descendents of the specified folder that have the specified type asset type + static S32 getDirectDescendentsItemCount(const LLInventoryCategory* pFolder, LLAssetType::EType filterType); // A "folded folder" is a folder whose items logically belong to the grandparent rather than the parent static bool isFoldedFolder(const LLInventoryCategory* pFolder, bool fCheckComposite);