diff options
author | Steven Bennetts <steve@lindenlab.com> | 2009-08-17 17:02:48 +0000 |
---|---|---|
committer | Steven Bennetts <steve@lindenlab.com> | 2009-08-17 17:02:48 +0000 |
commit | 36e932b4d8590171d8fb3552db89c915684629c9 (patch) | |
tree | 524746d4bea01f5f00f24f1dd08ca3634104f381 /indra/newview/lllandmarkactions.cpp | |
parent | 1c7e298e21fbdfada72418a73841c7664cd8ee8b (diff) |
merge https://svn.aws.productengine.com/secondlife/export-from-ll/viewer-2-0@1351 https://svn.aws.productengine.com/secondlife/pe/stable-1@1365 -> viewer-2.0.0-3
EXT 451 EXT-303 EXT-367 EXT-367 EXT-371 EXT-394 EXT-494 EXT-502 EXT-503 EXT-516 EXT-538 EXT-540
Diffstat (limited to 'indra/newview/lllandmarkactions.cpp')
-rw-r--r-- | indra/newview/lllandmarkactions.cpp | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/indra/newview/lllandmarkactions.cpp b/indra/newview/lllandmarkactions.cpp index a341d81b94..aa5432740c 100644 --- a/indra/newview/lllandmarkactions.cpp +++ b/indra/newview/lllandmarkactions.cpp @@ -77,11 +77,14 @@ class LLFetchLandmarksByName : public LLInventoryCollectFunctor { private: std::string name; + BOOL use_substring; public: -LLFetchLandmarksByName(std::string &landmark_name) -:name(landmark_name) +LLFetchLandmarksByName(std::string &landmark_name, BOOL if_use_substring) +:name(landmark_name), +use_substring(if_use_substring) { + LLStringUtil::toLower(name); } public: @@ -94,20 +97,28 @@ public: if (!landmark) // the landmark not been loaded yet return false; - if (item->getName() == name) + std::string landmark_name = item->getName(); + LLStringUtil::toLower(landmark_name); + if(use_substring) { - return true; + if ( landmark_name.find( name ) != std::string::npos) + return true; + } + else + { + if ( landmark_name == name ) + return true; } return false; } }; -LLInventoryModel::item_array_t LLLandmarkActions::fetchLandmarksByName(std::string& name) +LLInventoryModel::item_array_t LLLandmarkActions::fetchLandmarksByName(std::string& name, BOOL if_starts_with) { LLInventoryModel::cat_array_t cats; LLInventoryModel::item_array_t items; - LLFetchLandmarksByName fetchLandmarks(name); + LLFetchLandmarksByName fetchLandmarks(name, if_starts_with); gInventory.collectDescendentsIf(gInventory.getRootFolderID(), cats, items, @@ -115,6 +126,7 @@ LLInventoryModel::item_array_t LLLandmarkActions::fetchLandmarksByName(std::stri fetchLandmarks); return items; } + bool LLLandmarkActions::landmarkAlreadyExists() { // Determine whether there are landmarks pointing to the current parcel. |