From 48ccb5755e97926f528f22998826643b91b61e14 Mon Sep 17 00:00:00 2001 From: Vadim Savchuk Date: Wed, 9 Jun 2010 18:19:23 +0300 Subject: EXT-6726 ADDITIONAL FIX Minor code cleanup. Removed duplicated code from LLFolderBridge::isItemRenameable(). Requested by Richard at https://codereview.productengine.com/secondlife/r/466/ --HG-- branch : product-engine --- indra/newview/llinventorybridge.cpp | 8 +------- indra/newview/llinventoryfunctions.cpp | 5 +++++ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 3a9c5ba698..94d421f61c 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -2208,13 +2208,7 @@ void LLFolderBridge::determineFolderType() BOOL LLFolderBridge::isItemRenameable() const { - LLViewerInventoryCategory* cat = (LLViewerInventoryCategory*)getCategory(); - if(cat && !LLFolderType::lookupIsProtectedType(cat->getPreferredType()) - && (cat->getOwnerID() == gAgent.getID())) - { - return TRUE; - } - return FALSE; + return get_is_category_renameable(getInventoryModel(), mUUID); } void LLFolderBridge::restoreItem() diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp index ca6cede7e9..c86d463a08 100644 --- a/indra/newview/llinventoryfunctions.cpp +++ b/indra/newview/llinventoryfunctions.cpp @@ -309,6 +309,11 @@ BOOL get_is_category_removable(const LLInventoryModel* model, const LLUUID& id) BOOL get_is_category_renameable(const LLInventoryModel* model, const LLUUID& id) { + if (!model) + { + return FALSE; + } + LLViewerInventoryCategory* cat = model->getCategory(id); if (cat && !LLFolderType::lookupIsProtectedType(cat->getPreferredType()) && -- cgit v1.3