summaryrefslogtreecommitdiff
path: root/indra/newview/llinventoryfilter.cpp
diff options
context:
space:
mode:
authorRichard Linden <none@none>2012-08-01 01:27:38 -0700
committerRichard Linden <none@none>2012-08-01 01:27:38 -0700
commit997812c7b04f9edc119006baeb261cf602631978 (patch)
treeec470bc9af3cb207d9e9a504728bda679be673fe /indra/newview/llinventoryfilter.cpp
parenta204059d2e69fb33cb1a3c8d2fbed35d3967297c (diff)
parent2855e8bf8e91454e814cdd00985056830d8a8f5b (diff)
merge with ssh://hg.lindenlab.com/richard/viewer-chui
Diffstat (limited to 'indra/newview/llinventoryfilter.cpp')
-rw-r--r--indra/newview/llinventoryfilter.cpp18
1 files changed, 12 insertions, 6 deletions
diff --git a/indra/newview/llinventoryfilter.cpp b/indra/newview/llinventoryfilter.cpp
index 7993dd04c5..c913269aad 100644
--- a/indra/newview/llinventoryfilter.cpp
+++ b/indra/newview/llinventoryfilter.cpp
@@ -94,9 +94,9 @@ bool LLInventoryFilter::check(const LLFolderViewModelItem* item)
return passed_clipboard;
}
- std::string::size_type string_offset = mFilterSubString.size() ? listener->getSearchableName().find(mFilterSubString) : 0;
+ std::string::size_type string_offset = mFilterSubString.size() ? listener->getSearchableName().find(mFilterSubString) : std::string::npos;
- BOOL passed = string_offset != std::string::npos;
+ BOOL passed = (mFilterSubString.size() == 0 || string_offset != std::string::npos);
passed = passed && checkAgainstFilterType(listener);
passed = passed && checkAgainstPermissions(listener);
passed = passed && checkAgainstFilterLinks(listener);
@@ -107,7 +107,7 @@ bool LLInventoryFilter::check(const LLFolderViewModelItem* item)
bool LLInventoryFilter::check(const LLInventoryItem* item)
{
- std::string::size_type string_offset = mFilterSubString.size() ? item->getName().find(mFilterSubString) : std::string::npos;
+ std::string::size_type string_offset = mFilterSubString.size() ? item->getName().find(mFilterSubString) : std::string::npos;
const bool passed_filtertype = checkAgainstFilterType(item);
const bool passed_permissions = checkAgainstPermissions(item);
@@ -115,7 +115,7 @@ bool LLInventoryFilter::check(const LLInventoryItem* item)
const bool passed = (passed_filtertype
&& passed_permissions
&& passed_clipboard
- && (mFilterSubString.size() == 0 || string_offset != std::string::npos));
+ && (mFilterSubString.size() == 0 || string_offset != std::string::npos));
return passed;
}
@@ -382,9 +382,10 @@ const std::string& LLInventoryFilter::getFilterSubString(BOOL trim) const
return mFilterSubString;
}
-std::string::size_type LLInventoryFilter::getStringMatchOffset(LLFolderViewItem* item) const
+std::string::size_type LLInventoryFilter::getStringMatchOffset(LLFolderViewModelItem* item) const
{
- return mFilterSubString.size() ? item->getName().find(mFilterSubString) : std::string::npos;
+ const LLFolderViewModelItemInventory* listener = static_cast<const LLFolderViewModelItemInventory*>(item);
+ return mFilterSubString.size() ? listener->getSearchableName().find(mFilterSubString) : std::string::npos;
}
bool LLInventoryFilter::isDefault() const
@@ -991,6 +992,11 @@ bool LLInventoryFilter::hasFilterString() const
return mFilterSubString.size() > 0;
}
+std::string::size_type LLInventoryFilter::getFilterStringSize() const
+{
+ return mFilterSubString.size();
+}
+
PermissionMask LLInventoryFilter::getFilterPermissions() const
{
return mFilterOps.mPermissions;