From 9b9c11778cd5d71f3b238ca5bd5b69e118d97be9 Mon Sep 17 00:00:00 2001
From: Andrew Polunin <apolunin@productengine.com>
Date: Thu, 19 Nov 2009 19:51:47 +0200
Subject: [PATCH] fixed minor bug EXT-1615 Landmark name is truncated before @
 character after placing landmark on Favorites Bar

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

diff --git a/indra/newview/llpanellandmarkinfo.cpp b/indra/newview/llpanellandmarkinfo.cpp
index f94a59ecef5..5de7c3f851e 100644
--- a/indra/newview/llpanellandmarkinfo.cpp
+++ b/indra/newview/llpanellandmarkinfo.cpp
@@ -352,6 +352,8 @@ void LLPanelLandmarkInfo::createLandmark(const LLUUID& folder_id)
 	}
 
 	LLStringUtil::replaceChar(desc, '\n', ' ');
+	LLViewerInventoryItem::insertDefaultSortField(name);
+
 	// If no folder chosen use the "Landmarks" folder.
 	LLLandmarkActions::createLandmarkHere(name, desc,
 		folder_id.notNull() ? folder_id : gInventory.findCategoryUUIDForType(LLFolderType::FT_LANDMARK));
diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp
index 089535dfab4..87d256b60a9 100644
--- a/indra/newview/llviewerinventory.cpp
+++ b/indra/newview/llviewerinventory.cpp
@@ -1336,6 +1336,12 @@ BOOL LLViewerInventoryItem::extractSortFieldAndDisplayName(const std::string& na
 	return result;
 }
 
+void LLViewerInventoryItem::insertDefaultSortField(std::string& name)
+{
+	name.insert(0, std::string("1") + getSeparator());
+}
+
+
 // This returns true if the item that this item points to 
 // doesn't exist in memory (i.e. LLInventoryModel).  The baseitem
 // might still be in the database but just not loaded yet.
diff --git a/indra/newview/llviewerinventory.h b/indra/newview/llviewerinventory.h
index 529425aa258..d27faffdd9e 100644
--- a/indra/newview/llviewerinventory.h
+++ b/indra/newview/llviewerinventory.h
@@ -81,6 +81,7 @@ class LLViewerInventoryItem : public LLInventoryItem, public boost::signals2::tr
 	virtual U32 getCRC32() const; // really more of a checksum.
 
 	static BOOL extractSortFieldAndDisplayName(const std::string& name, S32* sortField, std::string* displayName);
+	static void insertDefaultSortField(std::string& name);
 
 	// construct a complete viewer inventory item
 	LLViewerInventoryItem(const LLUUID& uuid, const LLUUID& parent_uuid,
-- 
GitLab