From 5c4ab75cdab1b9de08d482457f9d245dd18b90da Mon Sep 17 00:00:00 2001
From: Dmitry Zaporozhan <dzaporozhan@productengine.com>
Date: Mon, 18 Jan 2010 13:18:46 +0200
Subject: [PATCH] Fixed low bug EXT-4306 - Landmark name is shown with prefix
 in the group notice attachment.

--HG--
branch : product-engine
---
 indra/newview/llpanelgroupnotices.cpp | 2 +-
 indra/newview/llviewerinventory.cpp   | 9 +++++++++
 indra/newview/llviewerinventory.h     | 1 +
 3 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/indra/newview/llpanelgroupnotices.cpp b/indra/newview/llpanelgroupnotices.cpp
index 6210973dae2..45fc3d46882 100644
--- a/indra/newview/llpanelgroupnotices.cpp
+++ b/indra/newview/llpanelgroupnotices.cpp
@@ -614,7 +614,7 @@ void LLPanelGroupNotices::showNotice(const std::string& subject,
 		mViewInventoryIcon->setVisible(TRUE);
 
 		std::stringstream ss;
-		ss << "        " << inventory_name;
+		ss << "        " << LLViewerInventoryItem::getDisplayName(inventory_name);
 
 		mViewInventoryName->setText(ss.str());
 		mBtnOpenAttachment->setEnabled(TRUE);
diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp
index 3bed2d36c20..31dc83e75a3 100644
--- a/indra/newview/llviewerinventory.cpp
+++ b/indra/newview/llviewerinventory.cpp
@@ -1165,6 +1165,15 @@ const std::string& LLViewerInventoryItem::getDisplayName() const
 	return mDisplayName = hasSortField ? result : LLInventoryItem::getName();
 }
 
+// static
+std::string LLViewerInventoryItem::getDisplayName(const std::string& name)
+{
+	std::string result;
+	BOOL hasSortField = extractSortFieldAndDisplayName(name, 0, &result);
+
+	return hasSortField ? result : name;
+}
+
 S32 LLViewerInventoryItem::getSortField() const
 {
 	S32 result;
diff --git a/indra/newview/llviewerinventory.h b/indra/newview/llviewerinventory.h
index c4b7fdaa234..917b8747eaa 100644
--- a/indra/newview/llviewerinventory.h
+++ b/indra/newview/llviewerinventory.h
@@ -66,6 +66,7 @@ class LLViewerInventoryItem : public LLInventoryItem, public boost::signals2::tr
 	virtual const LLUUID& getAssetUUID() const;
 	virtual const std::string& getName() const;
 	virtual const std::string& getDisplayName() const;
+	static std::string getDisplayName(const std::string& name);
 	virtual S32 getSortField() const;
 	virtual void setSortField(S32 sortField);
 	virtual void rename(const std::string& new_name);
-- 
GitLab