diff options
Diffstat (limited to 'indra/llui')
-rwxr-xr-x | indra/llui/llfolderview.cpp | 14 | ||||
-rwxr-xr-x | indra/llui/llfolderview.h | 2 | ||||
-rwxr-xr-x | indra/llui/llfolderviewmodel.h | 33 | ||||
-rwxr-xr-x | indra/llui/lltexteditor.cpp | 3 |
4 files changed, 33 insertions, 19 deletions
diff --git a/indra/llui/llfolderview.cpp b/indra/llui/llfolderview.cpp index 602bd1a23a..0568388f56 100755 --- a/indra/llui/llfolderview.cpp +++ b/indra/llui/llfolderview.cpp @@ -630,6 +630,8 @@ bool LLFolderView::startDrag() void LLFolderView::commitRename( const LLSD& data ) { finishRenamingItem(); + arrange( NULL, NULL ); + } void LLFolderView::draw() @@ -1607,19 +1609,21 @@ void LLFolderView::update() return; } - if (getFolderViewModel()->getFilter().isModified() && getFolderViewModel()->getFilter().isNotDefault()) + LLFolderViewFilter& filter_object = getFolderViewModel()->getFilter(); + + if (filter_object.isModified() && filter_object.isNotDefault()) { mNeedsAutoSelect = TRUE; } // Filter to determine visibility before arranging - filter(getFolderViewModel()->getFilter()); + filter(filter_object); // Clear the modified setting on the filter only if the filter finished after running the filter process // Note: if the filter count has timed out, that means the filter halted before completing the entire set of items - if (getFolderViewModel()->getFilter().isModified() && (!getFolderViewModel()->getFilter().isTimedOut())) + if (filter_object.isModified() && (!filter_object.isTimedOut())) { - getFolderViewModel()->getFilter().clearModified(); + filter_object.clearModified(); } // automatically show matching items, and select first one if we had a selection @@ -1638,7 +1642,7 @@ void LLFolderView::update() // Open filtered folders for folder views with mAutoSelectOverride=TRUE. // Used by LLPlacesFolderView. - if (getFolderViewModel()->getFilter().showAllResults()) + if (filter_object.showAllResults()) { // these are named variables to get around gcc not binding non-const references to rvalues // and functor application is inherently non-const to allow for stateful functors diff --git a/indra/llui/llfolderview.h b/indra/llui/llfolderview.h index f188fdd0dc..08e0a6220a 100755 --- a/indra/llui/llfolderview.h +++ b/indra/llui/llfolderview.h @@ -235,7 +235,7 @@ public: virtual S32 notify(const LLSD& info) ; bool useLabelSuffix() { return mUseLabelSuffix; } - void updateMenu(); + virtual void updateMenu(); // Note: We may eventually have to move that method up the hierarchy to LLFolderViewItem. LLHandle<LLFolderView> getHandle() const { return getDerivedHandle<LLFolderView>(); } diff --git a/indra/llui/llfolderviewmodel.h b/indra/llui/llfolderviewmodel.h index c665dce509..8d98363c5f 100755 --- a/indra/llui/llfolderviewmodel.h +++ b/indra/llui/llfolderviewmodel.h @@ -393,27 +393,36 @@ template <typename SORT_TYPE, typename ITEM_TYPE, typename FOLDER_TYPE, typename class LLFolderViewModel : public LLFolderViewModelCommon { public: - LLFolderViewModel(){} - virtual ~LLFolderViewModel() {} - typedef SORT_TYPE SortType; typedef ITEM_TYPE ItemType; typedef FOLDER_TYPE FolderType; typedef FILTER_TYPE FilterType; - virtual SortType& getSorter() { return mSorter; } - virtual const SortType& getSorter() const { return mSorter; } - virtual void setSorter(const SortType& sorter) { mSorter = sorter; requestSortAll(); } + LLFolderViewModel(SortType* sorter, FilterType* filter) + : mSorter(sorter), + mFilter(filter) + {} - virtual FilterType& getFilter() { return mFilter; } - virtual const FilterType& getFilter() const { return mFilter; } - virtual void setFilter(const FilterType& filter) { mFilter = filter; } + virtual ~LLFolderViewModel() + { + delete mSorter; + mSorter = NULL; + delete mFilter; + mFilter = NULL; + } + + virtual SortType& getSorter() { return *mSorter; } + virtual const SortType& getSorter() const { return *mSorter; } + virtual void setSorter(const SortType& sorter) { mSorter = new SortType(sorter); requestSortAll(); } + + virtual FilterType& getFilter() { return *mFilter; } + virtual const FilterType& getFilter() const { return *mFilter; } + virtual void setFilter(const FilterType& filter) { mFilter = new FilterType(filter); } // By default, we assume the content is available. If a network fetch mechanism is implemented for the model, // this method needs to be overloaded and return the relevant fetch status. virtual bool contentsReady() { return true; } - struct ViewModelCompare { ViewModelCompare(const SortType& sorter) @@ -445,8 +454,8 @@ public: } protected: - SortType mSorter; - FilterType mFilter; + SortType* mSorter; + FilterType* mFilter; }; #endif // LLFOLDERVIEWMODEL_H diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp index 517142bf17..b4ebed0849 100755 --- a/indra/llui/lltexteditor.cpp +++ b/indra/llui/lltexteditor.cpp @@ -2339,7 +2339,8 @@ void LLTextEditor::autoIndent() S32 i; LLWString text = getWText(); - while( ' ' == text[line_start] ) + S32 offset = getLineOffsetFromDocIndex(mCursorPos); + while(( ' ' == text[line_start] ) && (space_count < offset)) { space_count++; line_start++; |