summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorMerov Linden <merov@lindenlab.com>2014-08-31 21:16:34 -0700
committerMerov Linden <merov@lindenlab.com>2014-08-31 21:16:34 -0700
commita5afdf0b9715d677ce49e24aea96c002e85e3769 (patch)
tree0c3bcdd781978723d0dbdb064031e385b29d40b1 /indra/newview
parent884fb1de2d3c05612d5b8256637ddf7cba24e94b (diff)
DD-179 : Return no listing for a lone object lost under the marketplace listing root
Diffstat (limited to 'indra/newview')
-rwxr-xr-xindra/newview/llinventoryfunctions.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp
index 58a10fe180..6986ac664f 100755
--- a/indra/newview/llinventoryfunctions.cpp
+++ b/indra/newview/llinventoryfunctions.cpp
@@ -841,8 +841,20 @@ S32 depth_nesting_in_marketplace(LLUUID cur_uuid)
// Returns the UUID of the marketplace listing this object is in
LLUUID nested_parent_id(LLUUID cur_uuid, S32 depth)
{
+ if (depth < 1)
+ {
+ // For objects outside the marketplace listings root (or root itself), we return a NULL UUID
+ return LLUUID::null;
+ }
+ else if (depth == 1)
+ {
+ // Just under the root, we return the passed UUID itself if it's a folder, NULL otherwise (not a listing)
+ LLViewerInventoryCategory* cat = gInventory.getCategory(cur_uuid);
+ return (cat ? cur_uuid : LLUUID::null);
+ }
+
+ // depth > 1
LLInventoryObject* cur_object = gInventory.getObject(cur_uuid);
- cur_uuid = (depth < 1 ? LLUUID::null : cur_uuid);
while (depth > 1)
{
depth--;