diff options
Diffstat (limited to 'indra')
-rw-r--r-- | indra/llui/llfolderviewitem.cpp | 6 | ||||
-rw-r--r-- | indra/llui/llfolderviewmodel.h | 20 | ||||
-rw-r--r-- | indra/llui/lltooltip.cpp | 2 | ||||
-rw-r--r-- | indra/newview/llfolderviewmodelinventory.cpp | 42 | ||||
-rw-r--r-- | indra/newview/llfolderviewmodelinventory.h | 6 | ||||
-rw-r--r-- | indra/newview/llimfloatercontainer.h | 4 |
6 files changed, 52 insertions, 28 deletions
diff --git a/indra/llui/llfolderviewitem.cpp b/indra/llui/llfolderviewitem.cpp index 480332ae70..5238bfd7e4 100644 --- a/indra/llui/llfolderviewitem.cpp +++ b/indra/llui/llfolderviewitem.cpp @@ -801,14 +801,14 @@ void LLFolderViewItem::draw() } const LLFolderViewModelInterface* LLFolderViewItem::getFolderViewModel( void ) const - { +{ return getRoot()->getFolderViewModel(); } LLFolderViewModelInterface* LLFolderViewItem::getFolderViewModel( void ) - { +{ return getRoot()->getFolderViewModel(); - } +} ///---------------------------------------------------------------------------- diff --git a/indra/llui/llfolderviewmodel.h b/indra/llui/llfolderviewmodel.h index c4d98657e2..9908e538a4 100644 --- a/indra/llui/llfolderviewmodel.h +++ b/indra/llui/llfolderviewmodel.h @@ -172,10 +172,11 @@ public: virtual bool potentiallyVisible() = 0; // is the item definitely visible or we haven't made up our minds yet? - virtual void filter( LLFolderViewFilter& filter) = 0; + virtual bool filter( LLFolderViewFilter& filter) = 0; virtual bool passedFilter(S32 filter_generation = -1) = 0; virtual bool descendantsPassedFilter(S32 filter_generation = -1) = 0; - virtual void setPassedFilter(bool passed, bool passed_folder, S32 filter_generation, std::string::size_type string_offset = std::string::npos, std::string::size_type string_size = 0) = 0; + virtual void setPassedFilter(bool passed, S32 filter_generation, std::string::size_type string_offset = std::string::npos, std::string::size_type string_size = 0) = 0; + virtual void setPassedFolderFilter(bool passed, S32 filter_generation) = 0; virtual void dirtyFilter() = 0; virtual bool hasFilterStringMatch() = 0; virtual std::string::size_type getFilterStringOffset() = 0; @@ -219,6 +220,7 @@ public: mStringFilterSize(0), mFolderViewItem(NULL), mLastFilterGeneration(-1), + mLastFolderFilterGeneration(-1), mMostFilteredDescendantGeneration(-1), mParent(NULL), mRootViewModel(root_view_model) @@ -231,9 +233,11 @@ public: void setSortVersion(S32 version) { mSortVersion = version;} S32 getLastFilterGeneration() const { return mLastFilterGeneration; } + S32 getLastFolderFilterGeneration() const { return mLastFolderFilterGeneration; } void dirtyFilter() { mLastFilterGeneration = -1; + mLastFolderFilterGeneration = -1; // bubble up dirty flag all the way to root if (mParent) @@ -259,15 +263,20 @@ public: dirtyFilter(); } - void setPassedFilter(bool passed, bool passed_folder, S32 filter_generation, std::string::size_type string_offset = std::string::npos, std::string::size_type string_size = 0) + void setPassedFilter(bool passed, S32 filter_generation, std::string::size_type string_offset = std::string::npos, std::string::size_type string_size = 0) { mPassedFilter = passed; - mPassedFolderFilter = passed_folder; mLastFilterGeneration = filter_generation; mStringMatchOffsetFilter = string_offset; mStringFilterSize = string_size; } + void setPassedFolderFilter(bool passed, S32 filter_generation) + { + mPassedFolderFilter = passed; + mLastFolderFilterGeneration = filter_generation; + } + virtual bool potentiallyVisible() { return passedFilter() // we've passed the filter @@ -280,7 +289,7 @@ public: if (filter_generation < 0) filter_generation = mRootViewModel.getFilter().getFirstSuccessGeneration(); - bool passed_folder_filter = mPassedFolderFilter && mLastFilterGeneration >= filter_generation; + bool passed_folder_filter = mPassedFolderFilter && mLastFolderFilterGeneration >= filter_generation; bool passed_filter = mPassedFilter && mLastFilterGeneration >= filter_generation; return passed_folder_filter && (descendantsPassedFilter(filter_generation) @@ -304,6 +313,7 @@ protected: std::string::size_type mStringFilterSize; S32 mLastFilterGeneration; + S32 mLastFolderFilterGeneration; S32 mMostFilteredDescendantGeneration; diff --git a/indra/llui/lltooltip.cpp b/indra/llui/lltooltip.cpp index f737d48abf..d4670efedf 100644 --- a/indra/llui/lltooltip.cpp +++ b/indra/llui/lltooltip.cpp @@ -288,7 +288,7 @@ void LLToolTip::initFromParams(const LLToolTip::Params& p) mTextBox->setText(p.message()); } - S32 text_width = llmin(p.max_width(), mTextBox->getTextPixelWidth()); + S32 text_width = llmin(p.max_width(), mTextBox->getTextPixelWidth() + 1); S32 text_height = mTextBox->getTextPixelHeight(); mTextBox->reshape(text_width, text_height); if (mInfoButton) diff --git a/indra/newview/llfolderviewmodelinventory.cpp b/indra/newview/llfolderviewmodelinventory.cpp index e2376b18d5..8a4b4bae84 100644 --- a/indra/newview/llfolderviewmodelinventory.cpp +++ b/indra/newview/llfolderviewmodelinventory.cpp @@ -125,9 +125,9 @@ void LLFolderViewModelItemInventory::requestSort() } } -void LLFolderViewModelItemInventory::setPassedFilter(bool passed, bool passed_folder, S32 filter_generation, std::string::size_type string_offset, std::string::size_type string_size) +void LLFolderViewModelItemInventory::setPassedFilter(bool passed, S32 filter_generation, std::string::size_type string_offset, std::string::size_type string_size) { - LLFolderViewModelItemCommon::setPassedFilter(passed, passed_folder, filter_generation, string_offset, string_size); + LLFolderViewModelItemCommon::setPassedFilter(passed, filter_generation, string_offset, string_size); bool passed_filter_before = mPrevPassedAllFilters; mPrevPassedAllFilters = passedFilter(filter_generation); @@ -143,14 +143,15 @@ void LLFolderViewModelItemInventory::setPassedFilter(bool passed, bool passed_fo } } -void LLFolderViewModelItemInventory::filterChildItem( LLFolderViewModelItem* item, LLFolderViewFilter& filter ) +bool LLFolderViewModelItemInventory::filterChildItem( LLFolderViewModelItem* item, LLFolderViewFilter& filter ) { S32 filter_generation = filter.getCurrentGeneration(); + bool continue_filtering = true; if (item->getLastFilterGeneration() < filter_generation) { // recursive application of the filter for child items - item->filter( filter ); + continue_filtering = item->filter( filter ); } // track latest generation to pass any child items, for each folder up to root @@ -164,22 +165,31 @@ void LLFolderViewModelItemInventory::filterChildItem( LLFolderViewModelItem* ite view_model = static_cast<LLFolderViewModelItemInventory*>(view_model->mParent); } } + + return continue_filtering; } -void LLFolderViewModelItemInventory::filter( LLFolderViewFilter& filter) +bool LLFolderViewModelItemInventory::filter( LLFolderViewFilter& filter) { const S32 filter_generation = filter.getCurrentGeneration(); const S32 must_pass_generation = filter.getFirstRequiredGeneration(); if (getLastFilterGeneration() >= must_pass_generation + && getLastFolderFilterGeneration() >= must_pass_generation && !passedFilter(must_pass_generation)) { // failed to pass an earlier filter that was a subset of the current one // go ahead and flag this item as done - setPassedFilter(false, false, filter_generation); - return; + setPassedFilter(false, filter_generation); + setPassedFolderFilter(false, filter_generation); + return true; } + const bool passed_filter_folder = (getInventoryType() == LLInventoryType::IT_CATEGORY) + ? filter.checkFolder(this) + : true; + setPassedFolderFilter(passed_filter_folder, filter_generation); + if(!mChildren.empty() && (getLastFilterGeneration() < must_pass_generation // haven't checked descendants against minimum required generation to pass || descendantsPassedFilter(must_pass_generation))) // or at least one descendant has passed the minimum requirement @@ -189,7 +199,10 @@ void LLFolderViewModelItemInventory::filter( LLFolderViewFilter& filter) iter != end_iter && filter.getFilterCount() > 0; ++iter) { - filterChildItem((*iter), filter); + if (!filterChildItem((*iter), filter)) + { + break; + } } } @@ -200,12 +213,13 @@ void LLFolderViewModelItemInventory::filter( LLFolderViewFilter& filter) { filter.decrementFilterCount(); - const BOOL passed_filter = filter.check(this); - const BOOL passed_filter_folder = (getInventoryType() == LLInventoryType::IT_CATEGORY) - ? filter.checkFolder(this) - : true; - - setPassedFilter(passed_filter, passed_filter_folder, filter_generation, filter.getStringMatchOffset(this), filter.getFilterStringSize()); + const bool passed_filter = filter.check(this); + setPassedFilter(passed_filter, filter_generation, filter.getStringMatchOffset(this), filter.getFilterStringSize()); + return true; + } + else + { + return false; } } diff --git a/indra/newview/llfolderviewmodelinventory.h b/indra/newview/llfolderviewmodelinventory.h index 664addf336..890d03d1c9 100644 --- a/indra/newview/llfolderviewmodelinventory.h +++ b/indra/newview/llfolderviewmodelinventory.h @@ -53,9 +53,9 @@ public: virtual EInventorySortGroup getSortGroup() const = 0; virtual LLInventoryObject* getInventoryObject() const = 0; virtual void requestSort(); - virtual void setPassedFilter(bool filtered, bool filtered_folder, S32 filter_generation, std::string::size_type string_offset = std::string::npos, std::string::size_type string_size = 0); - virtual void filter( LLFolderViewFilter& filter); - virtual void filterChildItem( LLFolderViewModelItem* item, LLFolderViewFilter& filter); + virtual void setPassedFilter(bool filtered, S32 filter_generation, std::string::size_type string_offset = std::string::npos, std::string::size_type string_size = 0); + virtual bool filter( LLFolderViewFilter& filter); + virtual bool filterChildItem( LLFolderViewModelItem* item, LLFolderViewFilter& filter); virtual BOOL startDrag(EDragAndDropType* type, LLUUID* id) const = 0; virtual LLToolDragAndDrop::ESource getDragSource() const = 0; diff --git a/indra/newview/llimfloatercontainer.h b/indra/newview/llimfloatercontainer.h index b352e8a004..5154b02dd6 100644 --- a/indra/newview/llimfloatercontainer.h +++ b/indra/newview/llimfloatercontainer.h @@ -89,9 +89,9 @@ public: virtual bool hasChildren() const { return FALSE; } virtual bool potentiallyVisible() { return true; } - virtual void filter( LLFolderViewFilter& filter) { } + virtual bool filter( LLFolderViewFilter& filter) { return false; } virtual bool descendantsPassedFilter(S32 filter_generation = -1) { return true; } - virtual void setPassedFilter(bool passed, bool passed_folder, S32 filter_generation, std::string::size_type string_offset = std::string::npos, std::string::size_type string_size = 0) { } + virtual void setPassedFilter(bool passed, S32 filter_generation, std::string::size_type string_offset = std::string::npos, std::string::size_type string_size = 0) { } virtual bool passedFilter(S32 filter_generation = -1) { return true; } // The action callbacks |