diff options
| author | Vadim Savchuk <vsavchuk@productengine.com> | 2010-02-03 17:32:57 +0200 |
|---|---|---|
| committer | Vadim Savchuk <vsavchuk@productengine.com> | 2010-02-03 17:32:57 +0200 |
| commit | 11228d4b7d6be72759625e604fc09bade3cd306e (patch) | |
| tree | 6865dda1aff6668d8c3038415e81210b285c4c59 /indra/newview/llinventorymodel.cpp | |
| parent | 11f732bbbe910c2a63efaeb9044d206142d69e2f (diff) | |
| parent | 8cbea388eaad8b40faa604f9d7fa2a64570548e2 (diff) | |
Merge from default branch
--HG--
branch : product-engine
Diffstat (limited to 'indra/newview/llinventorymodel.cpp')
| -rw-r--r-- | indra/newview/llinventorymodel.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index 961f7adc0a..7ec976604a 100644 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -218,7 +218,10 @@ BOOL LLInventoryModel::isObjectDescendentOf(const LLUUID& obj_id, const LLViewerInventoryCategory *LLInventoryModel::getFirstNondefaultParent(const LLUUID& obj_id) const { const LLInventoryObject* obj = getObject(obj_id); - const LLUUID& parent_id = obj->getParentUUID(); + + // Search up the parent chain until we get to root or an acceptable folder. + // This assumes there are no cycles in the tree else we'll get a hang. + LLUUID parent_id = obj->getParentUUID(); while (!parent_id.isNull()) { const LLViewerInventoryCategory *cat = getCategory(parent_id); @@ -230,6 +233,7 @@ const LLViewerInventoryCategory *LLInventoryModel::getFirstNondefaultParent(cons { return cat; } + parent_id = cat->getParentUUID(); } return NULL; } |
