From 5f6a025397d0bcca27adc01fcb6fc324b7bdbd4d Mon Sep 17 00:00:00 2001
From: Andrey Kleshchev <andreykproductengine@lindenlab.com>
Date: Fri, 19 Mar 2021 13:40:19 +0200
Subject: [PATCH] Revert "SL-14927 Some avatar names not resolving in chat"

This reverts commit a66932a091bac4d4ca1a861901b9cef619a406f7.
---
 indra/llui/llfolderviewitem.cpp | 10 ++--------
 indra/llui/llfolderviewitem.h   |  2 +-
 indra/llui/llfolderviewmodel.h  |  6 ++----
 3 files changed, 5 insertions(+), 13 deletions(-)

diff --git a/indra/llui/llfolderviewitem.cpp b/indra/llui/llfolderviewitem.cpp
index 31202f02bf1..9f6ceac768c 100644
--- a/indra/llui/llfolderviewitem.cpp
+++ b/indra/llui/llfolderviewitem.cpp
@@ -1608,7 +1608,7 @@ void LLFolderViewFolder::destroyView()
 
 // extractItem() removes the specified item from the folder, but
 // doesn't delete it.
-void LLFolderViewFolder::extractItem( LLFolderViewItem* item)
+void LLFolderViewFolder::extractItem( LLFolderViewItem* item )
 {
 	if (item->isSelected())
 		getRoot()->clearSelection();
@@ -1631,13 +1631,7 @@ void LLFolderViewFolder::extractItem( LLFolderViewItem* item)
 		mItems.erase(it);
 	}
 	//item has been removed, need to update filter
-    LLFolderViewModelItem* parent_model = getViewModelItem();
-    LLFolderViewModelItem* child_model = item->getViewModelItem();
-    if (child_model->getParent() == parent_model)
-    {
-        // in some cases model does not belong to parent view, is shared between views
-        parent_model->removeChild(child_model);
-    }
+	getViewModelItem()->removeChild(item->getViewModelItem());
 	//because an item is going away regardless of filter status, force rearrange
 	requestArrange();
 	removeChild(item);
diff --git a/indra/llui/llfolderviewitem.h b/indra/llui/llfolderviewitem.h
index 3bfc7ee8cf8..da09d139e98 100644
--- a/indra/llui/llfolderviewitem.h
+++ b/indra/llui/llfolderviewitem.h
@@ -387,7 +387,7 @@ class LLFolderViewFolder : public LLFolderViewItem
 
 	// extractItem() removes the specified item from the folder, but
 	// doesn't delete it.
-	virtual void extractItem( LLFolderViewItem* item);
+	virtual void extractItem( LLFolderViewItem* item );
 
 	// This function is called by a child that needs to be resorted.
 	void resort(LLFolderViewItem* item);
diff --git a/indra/llui/llfolderviewmodel.h b/indra/llui/llfolderviewmodel.h
index 8684c716722..f4ddfa8f18f 100644
--- a/indra/llui/llfolderviewmodel.h
+++ b/indra/llui/llfolderviewmodel.h
@@ -218,8 +218,7 @@ class LLFolderViewModelItem : public LLRefCount, public LLTrace::MemTrackable<LL
 	virtual S32 getSortVersion() = 0;
 	virtual void setSortVersion(S32 version) = 0;
 	virtual void setParent(LLFolderViewModelItem* parent) = 0;
-    virtual LLFolderViewModelItem* getParent() const = 0;
-	virtual bool hasParent() const = 0;
+	virtual bool hasParent() = 0;
 
 protected:
 
@@ -359,8 +358,7 @@ class LLFolderViewModelItemCommon : public LLFolderViewModelItem
 
 protected:
 	virtual void setParent(LLFolderViewModelItem* parent) { mParent = parent; }
-    virtual LLFolderViewModelItem* getParent() const { return mParent; }
-	virtual bool hasParent() const { return mParent != NULL; }
+	virtual bool hasParent() { return mParent != NULL; }
 
 	S32							mSortVersion;
 	bool						mPassedFilter;
-- 
GitLab