flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmcl...@apache.org
Subject git commit: [flex-sdk] [refs/heads/develop] - Fixed addItemAt location to sorted list (i.e. must be at the end) and the location of added item to a sorted filtered list (even when filtered it needs to be the sort location otherwise it can be out of order
Date Tue, 21 May 2013 08:20:04 GMT
Updated Branches:
  refs/heads/develop 4de87659c -> c2fd27cc9


Fixed addItemAt location to sorted list (i.e. must be at the end) and the location of added
item to a sorted filtered list (even when filtered it needs to be the sort location otherwise
it can be out of order).


Project: http://git-wip-us.apache.org/repos/asf/flex-sdk/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-sdk/commit/c2fd27cc
Tree: http://git-wip-us.apache.org/repos/asf/flex-sdk/tree/c2fd27cc
Diff: http://git-wip-us.apache.org/repos/asf/flex-sdk/diff/c2fd27cc

Branch: refs/heads/develop
Commit: c2fd27cc9062b86dc70b6cfc05afefe18f6e918b
Parents: 4de8765
Author: Justin Mclean <jmclean@apache.org>
Authored: Tue May 21 18:19:41 2013 +1000
Committer: Justin Mclean <jmclean@apache.org>
Committed: Tue May 21 18:19:41 2013 +1000

----------------------------------------------------------------------
 .../src/mx/collections/ListCollectionView.as       |   18 +++++++++-----
 1 files changed, 11 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/c2fd27cc/frameworks/projects/framework/src/mx/collections/ListCollectionView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/framework/src/mx/collections/ListCollectionView.as b/frameworks/projects/framework/src/mx/collections/ListCollectionView.as
index 6aceae3..6dc1a2f 100644
--- a/frameworks/projects/framework/src/mx/collections/ListCollectionView.as
+++ b/frameworks/projects/framework/src/mx/collections/ListCollectionView.as
@@ -593,8 +593,12 @@ public class ListCollectionView extends Proxy
 
         var listIndex:int = index;
 		
-        // if we're sorted addItemAt is meaningless, just add to the end
-		if (localIndex && filterFunction != null)
+		// if we're sorted addItemAt is meaningless, just add to the end
+		if (localIndex && sort)
+        {
+            listIndex = list.length;
+        }
+		else if (localIndex && filterFunction != null)
 		{
 			// if end of filtered list, put at end of source list
 			if (listIndex == localIndex.length)
@@ -604,10 +608,6 @@ public class ListCollectionView extends Proxy
 			else 
 				listIndex = list.getItemIndex(localIndex[index]);
 		}
-		else if (localIndex && sort)
-        {
-            listIndex = list.length;
-        }
 		// List is sorted or filtered but refresh has not been called
 		// Just add to end of list
 		else if (localIndex)
@@ -1158,7 +1158,11 @@ public class ListCollectionView extends Proxy
 				{
 					if (filterFunction(item))
 					{
-						loc = getFilteredItemIndex(item);
+						if (sort)
+							loc = findItem(item, Sort.ANY_INDEX_MODE, true);
+						else 
+							loc = getFilteredItemIndex(item);
+						
 						if (firstOne)
 						{
 							addLocation = loc;


Mime
View raw message