From a106d6cf78833a3e24f8d478807f6363e4af5652 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Mon, 29 Mar 2021 21:30:40 +0300 Subject: SL-13182 Turn on openmp paralellization on Windows --- indra/llui/llnotifications.cpp | 5 ----- indra/llui/llnotifications.h | 4 ---- 2 files changed, 9 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llnotifications.cpp b/indra/llui/llnotifications.cpp index 06ec648178..34f25ad9fa 100644 --- a/indra/llui/llnotifications.cpp +++ b/indra/llui/llnotifications.cpp @@ -1784,11 +1784,6 @@ LLNotificationPtr LLNotifications::find(LLUUID uuid) } } -void LLNotifications::forEachNotification(NotificationProcess process) -{ - std::for_each(mItems.begin(), mItems.end(), process); -} - std::string LLNotifications::getGlobalString(const std::string& key) const { GlobalStringMap::const_iterator it = mGlobalStrings.find(key); diff --git a/indra/llui/llnotifications.h b/indra/llui/llnotifications.h index 2f4578da17..184a0ad83d 100644 --- a/indra/llui/llnotifications.h +++ b/indra/llui/llnotifications.h @@ -916,10 +916,6 @@ public: void update(const LLNotificationPtr pNotif); LLNotificationPtr find(LLUUID uuid); - - typedef boost::function NotificationProcess; - - void forEachNotification(NotificationProcess process); // This is all stuff for managing the templates // take your template out -- cgit v1.2.3 From c2711f2d763cfbf96d8db48b0809dd7a6e65a73e Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Wed, 31 Mar 2021 23:46:08 +0300 Subject: Revert "SL-13182 Turn on openmp paralellization on Windows" This reverts commit a106d6cf78833a3e24f8d478807f6363e4af5652. --- indra/llui/llnotifications.cpp | 5 +++++ indra/llui/llnotifications.h | 4 ++++ 2 files changed, 9 insertions(+) (limited to 'indra/llui') diff --git a/indra/llui/llnotifications.cpp b/indra/llui/llnotifications.cpp index 34f25ad9fa..06ec648178 100644 --- a/indra/llui/llnotifications.cpp +++ b/indra/llui/llnotifications.cpp @@ -1784,6 +1784,11 @@ LLNotificationPtr LLNotifications::find(LLUUID uuid) } } +void LLNotifications::forEachNotification(NotificationProcess process) +{ + std::for_each(mItems.begin(), mItems.end(), process); +} + std::string LLNotifications::getGlobalString(const std::string& key) const { GlobalStringMap::const_iterator it = mGlobalStrings.find(key); diff --git a/indra/llui/llnotifications.h b/indra/llui/llnotifications.h index 184a0ad83d..2f4578da17 100644 --- a/indra/llui/llnotifications.h +++ b/indra/llui/llnotifications.h @@ -916,6 +916,10 @@ public: void update(const LLNotificationPtr pNotif); LLNotificationPtr find(LLUUID uuid); + + typedef boost::function NotificationProcess; + + void forEachNotification(NotificationProcess process); // This is all stuff for managing the templates // take your template out -- cgit v1.2.3 From 7ddbf118f5d1fde24c10b93432209fbe44d91345 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Wed, 24 Mar 2021 01:53:45 +0200 Subject: SL-13182 Split buildNewViews over frames --- indra/llui/llfolderviewitem.cpp | 14 ++++++++------ indra/llui/llfolderviewitem.h | 15 +++++++++++++-- 2 files changed, 21 insertions(+), 8 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llfolderviewitem.cpp b/indra/llui/llfolderviewitem.cpp index 1c6c7b1b35..f4a6053b57 100644 --- a/indra/llui/llfolderviewitem.cpp +++ b/indra/llui/llfolderviewitem.cpp @@ -132,7 +132,6 @@ LLFolderViewItem::LLFolderViewItem(const LLFolderViewItem::Params& p) mCutGeneration(0), mLabelStyle( LLFontGL::NORMAL ), mHasVisibleChildren(FALSE), - mIsFolderComplete(true), mLocalIndentation(p.folder_indentation), mIndentation(0), mItemHeight(p.item_height), @@ -1002,11 +1001,11 @@ LLFolderViewFolder::LLFolderViewFolder( const LLFolderViewItem::Params& p ): mCurHeight(0.f), mTargetHeight(0.f), mAutoOpenCountdown(0.f), + mIsFolderComplete(false), // folder might have children that are not loaded yet. + mAreChildrenInited(false), // folder might have children that are not built yet. mLastArrangeGeneration( -1 ), mLastCalculatedWidth(0) { - // folder might have children that are not loaded yet. Mark it as incomplete until chance to check it. - mIsFolderComplete = false; } void LLFolderViewFolder::updateLabelRotation() @@ -1062,13 +1061,16 @@ S32 LLFolderViewFolder::arrange( S32* width, S32* height ) { // Sort before laying out contents // Note that we sort from the root (CHUI-849) - getRoot()->getFolderViewModel()->sort(this); + if (mAreChildrenInited) + { + getRoot()->getFolderViewModel()->sort(this); + } LL_RECORD_BLOCK_TIME(FTM_ARRANGE); // evaluate mHasVisibleChildren mHasVisibleChildren = false; - if (getViewModelItem()->descendantsPassedFilter()) + if (mAreChildrenInited && getViewModelItem()->descendantsPassedFilter()) { // We have to verify that there's at least one child that's not filtered out bool found = false; @@ -1094,7 +1096,7 @@ S32 LLFolderViewFolder::arrange( S32* width, S32* height ) mHasVisibleChildren = found; } - if (!mIsFolderComplete) + if (!mIsFolderComplete && mAreChildrenInited) { mIsFolderComplete = getFolderViewModel()->isFolderComplete(this); } diff --git a/indra/llui/llfolderviewitem.h b/indra/llui/llfolderviewitem.h index da09d139e9..9df58d4478 100644 --- a/indra/llui/llfolderviewitem.h +++ b/indra/llui/llfolderviewitem.h @@ -116,7 +116,6 @@ protected: F32 mControlLabelRotation; LLFolderView* mRoot; bool mHasVisibleChildren, - mIsFolderComplete, // indicates that some children were not loaded/added yet mIsCurSelection, mDragAndDropTarget, mIsMouseOverTitle, @@ -219,7 +218,10 @@ public: BOOL hasVisibleChildren() { return mHasVisibleChildren; } // true if object can't have children - BOOL isFolderComplete() { return mIsFolderComplete; } + virtual bool isFolderComplete() { return true; } + // true if object can't have children + virtual bool areChildrenInited() { return true; } + virtual void setChildrenInited(bool inited) { } // Call through to the viewed object and return true if it can be // removed. Returns true if it's removed. @@ -334,6 +336,8 @@ protected: S32 mLastArrangeGeneration; S32 mLastCalculatedWidth; bool mNeedsSort; + bool mIsFolderComplete; // indicates that some children were not loaded/added yet + bool mAreChildrenInited; // indicates that no children were initialized public: typedef enum e_recurse_type @@ -385,6 +389,13 @@ public: // destroys this folder, and all children virtual void destroyView(); + // whether known children are fully loaded (arrange sets to true) + virtual bool isFolderComplete() { return mIsFolderComplete; } + + // whether known children are fully built + virtual bool areChildrenInited() { return mAreChildrenInited; } + virtual void setChildrenInited(bool inited) { mAreChildrenInited = inited; } + // extractItem() removes the specified item from the folder, but // doesn't delete it. virtual void extractItem( LLFolderViewItem* item ); -- cgit v1.2.3 From 5e134b4732e5224b1a5da929a4b12ac63ec120b4 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Fri, 9 Apr 2021 17:19:43 +0300 Subject: SL-13182 Fix root folder's state --- indra/llui/llfolderview.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra/llui') diff --git a/indra/llui/llfolderview.cpp b/indra/llui/llfolderview.cpp index 0c1dcc301b..bcca4d78a0 100644 --- a/indra/llui/llfolderview.cpp +++ b/indra/llui/llfolderview.cpp @@ -257,6 +257,8 @@ LLFolderView::LLFolderView(const Params& p) mPopupMenuHandle = menu->getHandle(); mViewModelItem->openItem(); + + mAreChildrenInited = true; // root folder is a special case due to not being loaded normally, assume that it's inited. } // Destroys the object -- cgit v1.2.3 From 9a1688322ab739f8838611d1b9e37d33adc07dfb Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Thu, 13 May 2021 17:51:24 +0300 Subject: SL-15195 The notification in chat history is multiplied after relogging --- indra/llui/llnotifications.cpp | 14 ++++++++++++++ indra/llui/llnotifications.h | 6 ++++++ 2 files changed, 20 insertions(+) (limited to 'indra/llui') diff --git a/indra/llui/llnotifications.cpp b/indra/llui/llnotifications.cpp index 06ec648178..c9e5c6653b 100644 --- a/indra/llui/llnotifications.cpp +++ b/indra/llui/llnotifications.cpp @@ -1699,6 +1699,20 @@ void LLNotifications::add(const LLNotificationPtr pNotif) updateItem(LLSD().with("sigtype", "add").with("id", pNotif->id()), pNotif); } +void LLNotifications::load(const LLNotificationPtr pNotif) +{ + if (pNotif == NULL) return; + + // first see if we already have it -- if so, that's a problem + LLNotificationSet::iterator it=mItems.find(pNotif); + if (it != mItems.end()) + { + LL_ERRS() << "Notification loaded a second time to the master notification channel." << LL_ENDL; + } + + updateItem(LLSD().with("sigtype", "load").with("id", pNotif->id()), pNotif); +} + void LLNotifications::cancel(LLNotificationPtr pNotif) { if (pNotif == NULL || pNotif->isCancelled()) return; diff --git a/indra/llui/llnotifications.h b/indra/llui/llnotifications.h index 2f4578da17..3ee48d1401 100644 --- a/indra/llui/llnotifications.h +++ b/indra/llui/llnotifications.h @@ -910,6 +910,7 @@ public: LLNotificationPtr add(const LLNotification::Params& p); void add(const LLNotificationPtr pNotif); + void load(const LLNotificationPtr pNotif); void cancel(LLNotificationPtr pNotif); void cancelByName(const std::string& name); void cancelByOwner(const LLUUID ownerId); @@ -1106,6 +1107,11 @@ private: mHistory.push_back(p); } + void onLoad(LLNotificationPtr p) + { + mHistory.push_back(p); + } + std::vector mHistory; }; -- cgit v1.2.3 From 9df87dd36575597d4c522b99a1f706e4861a416e Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Thu, 27 May 2021 23:51:59 +0300 Subject: SL-13179 FIXED Sorting residents banned on the parcel by duration is incorrect --- indra/llui/llscrolllistcell.cpp | 23 ++++++++++++++++++++++- indra/llui/llscrolllistcell.h | 7 +++++++ indra/llui/llscrolllistctrl.cpp | 18 ++++++++++++++---- indra/llui/llscrolllistctrl.h | 4 ++++ indra/llui/llscrolllistitem.cpp | 3 ++- indra/llui/llscrolllistitem.h | 4 ++++ 6 files changed, 53 insertions(+), 6 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llscrolllistcell.cpp b/indra/llui/llscrolllistcell.cpp index 13839da400..8dd552d2ad 100644 --- a/indra/llui/llscrolllistcell.cpp +++ b/indra/llui/llscrolllistcell.cpp @@ -79,6 +79,14 @@ const LLSD LLScrollListCell::getValue() const return LLStringUtil::null; } + +// virtual +const LLSD LLScrollListCell::getAltValue() const +{ + return LLStringUtil::null; +} + + // // LLScrollListIcon // @@ -173,6 +181,7 @@ U32 LLScrollListText::sCount = 0; LLScrollListText::LLScrollListText(const LLScrollListCell::Params& p) : LLScrollListCell(p), mText(p.label.isProvided() ? p.label() : p.value().asString()), + mAltText(p.alt_value().asString()), mFont(p.font), mColor(p.color), mUseColor(p.color.isProvided()), @@ -275,10 +284,22 @@ void LLScrollListText::setValue(const LLSD& text) setText(text.asString()); } +//virtual +void LLScrollListText::setAltValue(const LLSD& text) +{ + mAltText = text.asString(); +} + //virtual const LLSD LLScrollListText::getValue() const { - return LLSD(mText.getString()); + return LLSD(mText.getString()); +} + +//virtual +const LLSD LLScrollListText::getAltValue() const +{ + return LLSD(mAltText.getString()); } diff --git a/indra/llui/llscrolllistcell.h b/indra/llui/llscrolllistcell.h index 19576fb247..ede8d847d9 100644 --- a/indra/llui/llscrolllistcell.h +++ b/indra/llui/llscrolllistcell.h @@ -60,6 +60,7 @@ public: Optional userdata; Optional value; // state of checkbox, icon id/name, date + Optional alt_value; Optional label; // description or text Optional tool_tip; @@ -76,6 +77,7 @@ public: enabled("enabled", true), visible("visible", true), value("value"), + alt_value("alt_value", ""), label("label"), tool_tip("tool_tip", ""), font("font", LLFontGL::getFontSansSerifSmall()), @@ -98,7 +100,9 @@ public: virtual S32 getContentWidth() const { return 0; } virtual S32 getHeight() const { return 0; } virtual const LLSD getValue() const; + virtual const LLSD getAltValue() const; virtual void setValue(const LLSD& value) { } + virtual void setAltValue(const LLSD& value) { } virtual const std::string &getToolTip() const { return mToolTip; } virtual void setToolTip(const std::string &str) { mToolTip = str; } virtual BOOL getVisible() const { return TRUE; } @@ -138,7 +142,9 @@ public: /*virtual*/ S32 getContentWidth() const; /*virtual*/ S32 getHeight() const; /*virtual*/ void setValue(const LLSD& value); + /*virtual*/ void setAltValue(const LLSD& value); /*virtual*/ const LLSD getValue() const; + /*virtual*/ const LLSD getAltValue() const; /*virtual*/ BOOL getVisible() const; /*virtual*/ void highlightText(S32 offset, S32 num_chars); @@ -156,6 +162,7 @@ public: protected: LLUIString mText; + LLUIString mAltText; S32 mTextWidth; const LLFontGL* mFont; LLColor4 mColor; diff --git a/indra/llui/llscrolllistctrl.cpp b/indra/llui/llscrolllistctrl.cpp index be85f1cb6a..1059190712 100644 --- a/indra/llui/llscrolllistctrl.cpp +++ b/indra/llui/llscrolllistctrl.cpp @@ -66,9 +66,10 @@ static LLDefaultChildRegistry::Register r("scroll_list"); // local structures & classes. struct SortScrollListItem { - SortScrollListItem(const std::vector >& sort_orders,const LLScrollListCtrl::sort_signal_t* sort_signal) + SortScrollListItem(const std::vector >& sort_orders,const LLScrollListCtrl::sort_signal_t* sort_signal, bool alternate_sort) : mSortOrders(sort_orders) , mSortSignal(sort_signal) + , mAltSort(alternate_sort) {} bool operator()(const LLScrollListItem* i1, const LLScrollListItem* i2) @@ -93,7 +94,14 @@ struct SortScrollListItem } else { - sort_result = order * LLStringUtil::compareDict(cell1->getValue().asString(), cell2->getValue().asString()); + if (mAltSort && !cell1->getAltValue().asString().empty() && !cell2->getAltValue().asString().empty()) + { + sort_result = order * LLStringUtil::compareDict(cell1->getAltValue().asString(), cell2->getAltValue().asString()); + } + else + { + sort_result = order * LLStringUtil::compareDict(cell1->getValue().asString(), cell2->getValue().asString()); + } } if (sort_result != 0) { @@ -109,6 +117,7 @@ struct SortScrollListItem typedef std::vector > sort_order_t; const LLScrollListCtrl::sort_signal_t* mSortSignal; const sort_order_t& mSortOrders; + const bool mAltSort; }; //--------------------------------------------------------------------------- @@ -213,6 +222,7 @@ LLScrollListCtrl::LLScrollListCtrl(const LLScrollListCtrl::Params& p) mSearchColumn(p.search_column), mColumnPadding(p.column_padding), mRowPadding(p.row_padding), + mAlternateSort(false), mContextMenuType(MENU_NONE), mIsFriendSignal(NULL) { @@ -2680,7 +2690,7 @@ void LLScrollListCtrl::updateSort() const std::stable_sort( mItemList.begin(), mItemList.end(), - SortScrollListItem(mSortColumns,mSortCallback)); + SortScrollListItem(mSortColumns,mSortCallback, mAlternateSort)); mSorted = true; } @@ -2696,7 +2706,7 @@ void LLScrollListCtrl::sortOnce(S32 column, BOOL ascending) std::stable_sort( mItemList.begin(), mItemList.end(), - SortScrollListItem(sort_column,mSortCallback)); + SortScrollListItem(sort_column,mSortCallback,mAlternateSort)); } void LLScrollListCtrl::dirtyColumns() diff --git a/indra/llui/llscrolllistctrl.h b/indra/llui/llscrolllistctrl.h index 0cc481b113..08134bbfc8 100644 --- a/indra/llui/llscrolllistctrl.h +++ b/indra/llui/llscrolllistctrl.h @@ -398,6 +398,8 @@ public: BOOL hasSortOrder() const; void clearSortOrder(); + void setAlternateSort() { mAlternateSort = true; } + S32 selectMultiple( uuid_vec_t ids ); // conceptually const, but mutates mItemList void updateSort() const; @@ -482,6 +484,8 @@ private: bool mColumnsDirty; bool mColumnWidthsDirty; + bool mAlternateSort; + mutable item_list mItemList; LLScrollListItem *mLastSelected; diff --git a/indra/llui/llscrolllistitem.cpp b/indra/llui/llscrolllistitem.cpp index 51c615dd00..e1360f80cd 100644 --- a/indra/llui/llscrolllistitem.cpp +++ b/indra/llui/llscrolllistitem.cpp @@ -44,7 +44,8 @@ LLScrollListItem::LLScrollListItem( const Params& p ) mSelectedIndex(-1), mEnabled(p.enabled), mUserdata(p.userdata), - mItemValue(p.value) + mItemValue(p.value), + mItemAltValue(p.alt_value) { } diff --git a/indra/llui/llscrolllistitem.h b/indra/llui/llscrolllistitem.h index d2c3dd7721..a3398305b1 100644 --- a/indra/llui/llscrolllistitem.h +++ b/indra/llui/llscrolllistitem.h @@ -55,6 +55,7 @@ public: Optional enabled; Optional userdata; Optional value; + Optional alt_value; Ignored name; // use for localization tools Ignored type; @@ -65,6 +66,7 @@ public: Params() : enabled("enabled", true), value("value"), + alt_value("alt_value"), name("name"), type("type"), length("length"), @@ -97,6 +99,7 @@ public: virtual LLUUID getUUID() const { return mItemValue.asUUID(); } LLSD getValue() const { return mItemValue; } + LLSD getAltValue() const { return mItemAltValue; } void setRect(LLRect rect) { mRectangle = rect; } LLRect getRect() const { return mRectangle; } @@ -131,6 +134,7 @@ private: BOOL mEnabled; void* mUserdata; LLSD mItemValue; + LLSD mItemAltValue; std::vector mColumns; LLRect mRectangle; }; -- cgit v1.2.3 From 416ad1831f40052fccc01f012c4452d61e57f0f8 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Thu, 3 Jun 2021 23:46:55 +0300 Subject: SL-15340 The list of parcels is duplicated after reopening 1. Clean list before requesting 2. Don't trigger onOpen from menu if already open --- indra/llui/llfloaterreg.cpp | 52 +++++++++++++++++++++++++++++++++++++++++++++ indra/llui/llfloaterreg.h | 1 + indra/llui/llui.cpp | 1 + 3 files changed, 54 insertions(+) (limited to 'indra/llui') diff --git a/indra/llui/llfloaterreg.cpp b/indra/llui/llfloaterreg.cpp index 85e07fc6a6..0b27ff3567 100644 --- a/indra/llui/llfloaterreg.cpp +++ b/indra/llui/llfloaterreg.cpp @@ -524,6 +524,58 @@ void LLFloaterReg::toggleInstanceOrBringToFront(const LLSD& sdname, const LLSD& } } +// static +// Same as toggleInstanceOrBringToFront but does not close floater. +// unlike showInstance() does not trigger onOpen() if already open +void LLFloaterReg::showInstanceOrBringToFront(const LLSD& sdname, const LLSD& key) +{ + std::string name = sdname.asString(); + LLFloater* instance = getInstance(name, key); + + + if (!instance) + { + LL_DEBUGS() << "Unable to get instance of floater '" << name << "'" << LL_ENDL; + return; + } + + // If hosted, we need to take that into account + LLFloater* host = instance->getHost(); + + if (host) + { + if (host->isMinimized() || !host->isShown() || !host->isFrontmost()) + { + host->setMinimized(FALSE); + instance->openFloater(key); + instance->setVisibleAndFrontmost(true, key); + } + else if (!instance->getVisible()) + { + instance->openFloater(key); + instance->setVisibleAndFrontmost(true, key); + instance->setFocus(TRUE); + } + } + else + { + if (instance->isMinimized()) + { + instance->setMinimized(FALSE); + instance->setVisibleAndFrontmost(true, key); + } + else if (!instance->isShown()) + { + instance->openFloater(key); + instance->setVisibleAndFrontmost(true, key); + } + else if (!instance->isFrontmost()) + { + instance->setVisibleAndFrontmost(true, key); + } + } +} + // static U32 LLFloaterReg::getVisibleFloaterInstanceCount() { diff --git a/indra/llui/llfloaterreg.h b/indra/llui/llfloaterreg.h index e3b17dcb4f..b337579552 100644 --- a/indra/llui/llfloaterreg.h +++ b/indra/llui/llfloaterreg.h @@ -128,6 +128,7 @@ public: // Callback wrappers static void toggleInstanceOrBringToFront(const LLSD& sdname, const LLSD& key = LLSD()); + static void showInstanceOrBringToFront(const LLSD& sdname, const LLSD& key = LLSD()); // Typed find / get / show template diff --git a/indra/llui/llui.cpp b/indra/llui/llui.cpp index 656b69d3ed..f9e81dd43c 100644 --- a/indra/llui/llui.cpp +++ b/indra/llui/llui.cpp @@ -174,6 +174,7 @@ mHelpImpl(NULL) reg.add("Floater.Toggle", boost::bind(&LLFloaterReg::toggleInstance, _2, LLSD())); reg.add("Floater.ToggleOrBringToFront", boost::bind(&LLFloaterReg::toggleInstanceOrBringToFront, _2, LLSD())); reg.add("Floater.Show", boost::bind(&LLFloaterReg::showInstance, _2, LLSD(), FALSE)); + reg.add("Floater.ShowOrBringToFront", boost::bind(&LLFloaterReg::showInstanceOrBringToFront, _2, LLSD())); reg.add("Floater.Hide", boost::bind(&LLFloaterReg::hideInstance, _2, LLSD())); // Button initialization callback for toggle buttons -- cgit v1.2.3 From bdb4a90e7c8f05001cf084e30832cedde1b4a03e Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Fri, 8 Oct 2021 02:12:28 +0300 Subject: SL-16157 Crash at LLFontGL::maxDrawableChars --- indra/llui/lltextbase.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index 20bea7fe24..ea2d357d5d 100644 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -1558,11 +1558,14 @@ void LLTextBase::reflow() { // find first element whose end comes after start_index line_list_t::iterator iter = std::upper_bound(mLineInfoList.begin(), mLineInfoList.end(), start_index, line_end_compare()); - line_start_index = iter->mDocIndexStart; - line_count = iter->mLineNum; - cur_top = iter->mRect.mTop; - getSegmentAndOffset(iter->mDocIndexStart, &seg_iter, &seg_offset); - mLineInfoList.erase(iter, mLineInfoList.end()); + if (iter != mLineInfoList.end()) + { + line_start_index = iter->mDocIndexStart; + line_count = iter->mLineNum; + cur_top = iter->mRect.mTop; + getSegmentAndOffset(iter->mDocIndexStart, &seg_iter, &seg_offset); + mLineInfoList.erase(iter, mLineInfoList.end()); + } } S32 line_height = 0; -- cgit v1.2.3 From b41f6cd2b522f3ff8effdd17f63c067a468cd4e0 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Thu, 21 Oct 2021 23:58:18 +0300 Subject: SL-15387 Resolve some columns crashes Looks like mColumnsIndexed had dead pointers which resulted in a crash and there is some kind of hard to trigger interaction with searchable UI --- indra/llui/llscrolllistctrl.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llscrolllistctrl.cpp b/indra/llui/llscrolllistctrl.cpp index de644185fd..a63457bdea 100644 --- a/indra/llui/llscrolllistctrl.cpp +++ b/indra/llui/llscrolllistctrl.cpp @@ -336,8 +336,7 @@ LLScrollListCtrl::~LLScrollListCtrl() std::for_each(mItemList.begin(), mItemList.end(), DeletePointer()); mItemList.clear(); - std::for_each(mColumns.begin(), mColumns.end(), DeletePairedPointer()); - mColumns.clear(); + clearColumns(); //clears columns and deletes headers delete mIsFriendSignal; } @@ -3011,6 +3010,8 @@ void LLScrollListCtrl::clearColumns() mSortColumns.clear(); mTotalStaticColumnWidth = 0; mTotalColumnPadding = 0; + + dirtyColumns(); // Clears mColumnsIndexed } void LLScrollListCtrl::setColumnLabel(const std::string& column, const std::string& label) -- cgit v1.2.3