From 4e0d3bdd4da2bf376bf482f4430e05ba8a6fa01c Mon Sep 17 00:00:00 2001
From: andreykproductengine <akleshchev@productengine.com>
Date: Tue, 6 May 2014 17:21:18 +0300
Subject: [PATCH] MAINT-3977 FIXED Object does not display newly added contents
 if it was edited that session and you teleported to another region and back
 and then added new contents.

---
 indra/newview/llfloatertools.cpp         |  3 +++
 indra/newview/llpanelcontents.cpp        |  7 +++++++
 indra/newview/llpanelcontents.h          |  1 +
 indra/newview/llpanelobjectinventory.cpp | 11 ++++++++---
 indra/newview/llpanelobjectinventory.h   |  1 +
 5 files changed, 20 insertions(+), 3 deletions(-)

diff --git a/indra/newview/llfloatertools.cpp b/indra/newview/llfloatertools.cpp
index 802544089ca..bbb95e0cc4e 100755
--- a/indra/newview/llfloatertools.cpp
+++ b/indra/newview/llfloatertools.cpp
@@ -888,6 +888,9 @@ void LLFloaterTools::onClose(bool app_quitting)
 
 	// hide the advanced object weights floater
 	LLFloaterReg::hideInstance("object_weights");
+
+	// prepare content for next call
+	mPanelContents->clearContents();
 }
 
 void click_popup_info(void*)
diff --git a/indra/newview/llpanelcontents.cpp b/indra/newview/llpanelcontents.cpp
index 1a427338e5a..5be796ea7aa 100755
--- a/indra/newview/llpanelcontents.cpp
+++ b/indra/newview/llpanelcontents.cpp
@@ -141,6 +141,13 @@ void LLPanelContents::refresh()
 	}	
 }
 
+void LLPanelContents::clearContents()
+{
+	if (mPanelInventoryObject)
+	{
+		mPanelInventoryObject->clearInventoryTask();
+	}
+}
 
 
 //
diff --git a/indra/newview/llpanelcontents.h b/indra/newview/llpanelcontents.h
index 62ccb64a4cd..cf2c3af2a92 100755
--- a/indra/newview/llpanelcontents.h
+++ b/indra/newview/llpanelcontents.h
@@ -49,6 +49,7 @@ class LLPanelContents : public LLPanel
 	virtual ~LLPanelContents();
 
 	void			refresh();
+	void			clearContents();
 
 
 	static void		onClickNewScript(void*);
diff --git a/indra/newview/llpanelobjectinventory.cpp b/indra/newview/llpanelobjectinventory.cpp
index 6c9616511ff..95472874ec1 100755
--- a/indra/newview/llpanelobjectinventory.cpp
+++ b/indra/newview/llpanelobjectinventory.cpp
@@ -1862,14 +1862,19 @@ void LLPanelObjectInventory::refresh()
 	}
 	if(!has_inventory)
 	{
-		mTaskUUID = LLUUID::null;
-		removeVOInventoryListener();
-		clearContents();
+		clearInventoryTask();
 	}
 	mInventoryViewModel.setTaskID(mTaskUUID);
 	//llinfos << "LLPanelObjectInventory::refresh() " << mTaskUUID << llendl;
 }
 
+void LLPanelObjectInventory::clearInventoryTask()
+{
+	mTaskUUID = LLUUID::null;
+	removeVOInventoryListener();
+	clearContents();
+}
+
 void LLPanelObjectInventory::removeSelectedItem()
 {
 	if(mFolders)
diff --git a/indra/newview/llpanelobjectinventory.h b/indra/newview/llpanelobjectinventory.h
index 9559f7e8861..3de49242acc 100755
--- a/indra/newview/llpanelobjectinventory.h
+++ b/indra/newview/llpanelobjectinventory.h
@@ -62,6 +62,7 @@ class LLPanelObjectInventory : public LLPanel, public LLVOInventoryListener
 	
 	void refresh();
 	const LLUUID& getTaskUUID() { return mTaskUUID;}
+	void clearInventoryTask();
 	void removeSelectedItem();
 	void startRenamingSelectedItem();
 
-- 
GitLab