From 124c2f21a38563c81ae93681120518a7dd5cf38c Mon Sep 17 00:00:00 2001
From: Seth ProductEngine <slitovchuk@productengine.com>
Date: Fri, 29 Oct 2010 16:21:35 +0300
Subject: STORM-270, STORM-303 FIXED sorting Favorites folder contents after
 re-ordering landmarks in any folder view or in Favorites bar. Previously
 worked only for Favorites accordion is Places SP.

---
 indra/newview/llinventorypanel.cpp | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp
index 50adae09c0..0870b5b8dd 100644
--- a/indra/newview/llinventorypanel.cpp
+++ b/indra/newview/llinventorypanel.cpp
@@ -290,7 +290,10 @@ void LLInventoryPanel::modelChanged(U32 mask)
 		const LLUUID& item_id = (*items_iter);
 		const LLInventoryObject* model_item = model->getObject(item_id);
 		LLFolderViewItem* view_item = mFolderRoot->getItemByID(item_id);
-		LLFolderViewFolder* view_folder = mFolderRoot->getFolderByID(item_id);
+
+		// LLFolderViewFolder is derived from LLFolderViewItem so dynamic_cast from item
+		// to folder is the fast way to get a folder without searching through folders tree.
+		LLFolderViewFolder* view_folder = dynamic_cast<LLFolderViewFolder*>(view_item);
 
 		//////////////////////////////
 		// LABEL Operation
-- 
cgit v1.2.3


From 463969116fa64c6f90cd7eb455e2432db375d359 Mon Sep 17 00:00:00 2001
From: Vadim ProductEngine <vsavchuk@productengine.com>
Date: Fri, 29 Oct 2010 23:48:46 +0300
Subject: STORM-501 FIXED Script-editor shows ERRORS in the wrong line.

LLTextBase::setCursor() sometimes failed to work properly if line wrapping was enabled.
This is a slightly optimized version of the patch made by Satomi Ahn.
---
 doc/contributions.txt     |  2 ++
 indra/llui/lltextbase.cpp | 34 +++++++++++++++++++++++++++-------
 2 files changed, 29 insertions(+), 7 deletions(-)

diff --git a/doc/contributions.txt b/doc/contributions.txt
index ee2dea7344..b3d30c3a54 100644
--- a/doc/contributions.txt
+++ b/doc/contributions.txt
@@ -594,6 +594,8 @@ Salahzar Stenvaag
 	CT-321
 Sammy Frederix
 	VWR-6186
+Satomi Ahn
+	STORM-501
 Scrippy Scofield
 	VWR-3748
 Seg Baphomet
diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp
index 758df418e8..5721df6b36 100644
--- a/indra/llui/lltextbase.cpp
+++ b/indra/llui/lltextbase.cpp
@@ -2214,19 +2214,39 @@ bool LLTextBase::scrolledToEnd()
 	return mScroller->isAtBottom();
 }
 
-
 bool LLTextBase::setCursor(S32 row, S32 column)
 {
-	if (0 <= row && row < (S32)mLineInfoList.size())
+	if (row < 0 || column < 0) return false;
+
+	S32 n_lines = mLineInfoList.size();
+	for (S32 line = row; line < n_lines; ++line)
 	{
-		S32 doc_pos = mLineInfoList[row].mDocIndexStart;
-		column = llclamp(column, 0, mLineInfoList[row].mDocIndexEnd - mLineInfoList[row].mDocIndexStart - 1);
-		doc_pos += column;
-		updateCursorXPos();
+		const line_info& li = mLineInfoList[line];
+
+		if (li.mLineNum < row)
+		{
+			continue;
+		}
+		else if (li.mLineNum > row)
+		{
+			break; // invalid column specified
+		}
+
+		// Found the given row.
+		S32 line_length = li.mDocIndexEnd - li.mDocIndexStart;;
+		if (column >= line_length)
+		{
+			column -= line_length;
+			continue;
+		}
 
+		// Found the given column.
+		updateCursorXPos();
+		S32 doc_pos = li.mDocIndexStart + column;
 		return setCursorPos(doc_pos);
 	}
-	return false;
+
+	return false; // invalid row or column specified
 }
 
 
-- 
cgit v1.2.3