From a65c18c1d370b34cb41e8130bca2e5e068bac553 Mon Sep 17 00:00:00 2001
From: Mnikolenko Productengine <mnikolenko@productengine.com>
Date: Tue, 26 Sep 2017 11:21:02 +0300
Subject: [PATCH] MAINT-7824 FIXED Items inside other notecards with full perms
 refuse to copy into inventory when being looked at inside an object.

---
 indra/newview/llpreviewnotecard.cpp | 10 ++++++++++
 indra/newview/llpreviewnotecard.h   |  1 +
 indra/newview/llviewertexteditor.h  |  3 ++-
 3 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/indra/newview/llpreviewnotecard.cpp b/indra/newview/llpreviewnotecard.cpp
index 850c3b350dc..d4a8bbdf453 100644
--- a/indra/newview/llpreviewnotecard.cpp
+++ b/indra/newview/llpreviewnotecard.cpp
@@ -163,6 +163,16 @@ BOOL LLPreviewNotecard::canClose()
 	}
 }
 
+/* virtual */
+void LLPreviewNotecard::setObjectID(const LLUUID& object_id)
+{
+	LLPreview::setObjectID(object_id);
+
+	LLViewerTextEditor* editor = getChild<LLViewerTextEditor>("Notecard Editor");
+	editor->setNotecardObjectID(mObjectUUID);
+	editor->makePristine();
+}
+
 const LLInventoryItem* LLPreviewNotecard::getDragItem()
 {
 	LLViewerTextEditor* editor = getChild<LLViewerTextEditor>("Notecard Editor");
diff --git a/indra/newview/llpreviewnotecard.h b/indra/newview/llpreviewnotecard.h
index 017c4485bae..46a6d0ef501 100644
--- a/indra/newview/llpreviewnotecard.h
+++ b/indra/newview/llpreviewnotecard.h
@@ -47,6 +47,7 @@ class LLPreviewNotecard : public LLPreview
 	virtual ~LLPreviewNotecard();
 	
 	bool saveItem();
+	void setObjectID(const LLUUID& object_id);
 
 	// llview
 	virtual void draw();
diff --git a/indra/newview/llviewertexteditor.h b/indra/newview/llviewertexteditor.h
index 33cfca4f902..44f104dde11 100644
--- a/indra/newview/llviewertexteditor.h
+++ b/indra/newview/llviewertexteditor.h
@@ -71,7 +71,8 @@ class LLViewerTextEditor : public LLTextEditor
 		mObjectID = object_id;
 		mPreviewID = preview_id;
 	}
-	
+	void setNotecardObjectID(const LLUUID& object_id){ mObjectID = object_id;}
+
 	void setASCIIEmbeddedText(const std::string& instr);
 	void setEmbeddedText(const std::string& instr);
 	std::string getEmbeddedText();
-- 
GitLab