flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmcl...@apache.org
Subject [3/6] git commit: [flex-sdk] [refs/heads/develop] - FLEX-15903 added check for filter function to stop RTE fixed up comment spacing
Date Sat, 11 May 2013 03:45:16 GMT
FLEX-15903 added check for filter function to stop RTE
fixed up comment spacing


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

Branch: refs/heads/develop
Commit: d79d9ba8f0c4cd29a6ab621ea100bc9a8973edf3
Parents: 01e92f1
Author: Justin Mclean <jmclean@apache.org>
Authored: Sat May 11 13:02:30 2013 +1000
Committer: Justin Mclean <jmclean@apache.org>
Committed: Sat May 11 13:02:30 2013 +1000

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


http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/d79d9ba8/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 30c4694..9c8ee8d 100644
--- a/frameworks/projects/framework/src/mx/collections/ListCollectionView.as
+++ b/frameworks/projects/framework/src/mx/collections/ListCollectionView.as
@@ -594,7 +594,7 @@ public class ListCollectionView extends Proxy
         }
 
         var listIndex:int = index;
-        //if we're sorted addItemAt is meaningless, just add to the end
+        // if we're sorted addItemAt is meaningless, just add to the end
         if (localIndex && sort)
         {
             listIndex = list.length;
@@ -735,16 +735,20 @@ public class ListCollectionView extends Proxy
      */
     private function getFilteredItemIndex(item:Object):int
     { 
-        //loc is wrong 
-        //the intent of this function is to find where this new item 
-        //should be in the filtered list, by looking at the main list 
-        //for it's neighbor that is also in this filtered list 
-        //and trying to insert item after that neighbor in the insert locao filtered list

+        // loc is wrong 
+        // the intent of this function is to find where this new item 
+        // should be in the filtered list, by looking at the main list 
+        // for it's neighbor that is also in this filtered list 
+        // and trying to insert item after that neighbor in the insert locao filtered list

     
-        //1st get the position in the original list 
+        // 1st get the position in the original list 
         var loc:int = list.getItemIndex(item); 
+		
+		// something gone wrong and list is not filtered so just return loc to stop RTE
+		if (filterFunction == null)
+			return loc;
     
-        //if it's 0 then item must be also the first in the filtered list 
+        // if it's 0 then item must be also the first in the filtered list 
         if (loc == 0) 
             return 0; 
     
@@ -756,7 +760,7 @@ public class ListCollectionView extends Proxy
             { 
                 var len:int = localIndex.length; 
                 // get the index of the item in the filtered set 
-                //for (var j:int = 0; j < len; j++) 
+                // for (var j:int = 0; j < len; j++) 
                 for (var j:int = 0; j < len; j++) 
                 { 
                     if (localIndex[j] == prevItem) 
@@ -765,8 +769,8 @@ public class ListCollectionView extends Proxy
             } 
         } 
 
-        //turns out that there are no neighbors of item in the filtered 
-        //list, so item is the 1st item 
+        // turns out that there are no neighbors of item in the filtered 
+        // list, so item is the 1st item 
         return 0; 
     }
     


Mime
View raw message