incubator-flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aha...@apache.org
Subject svn commit: r1389214 - /incubator/flex/sdk/branches/develop/mustella/tests/spark/collections/Sort/SWFs/newComps/BaseDataComp.mxml
Date Mon, 24 Sep 2012 05:50:35 GMT
Author: aharui
Date: Mon Sep 24 05:50:35 2012
New Revision: 1389214

URL: http://svn.apache.org/viewvc?rev=1389214&view=rev
Log:
Modify test to compute the results from flash.globalization.Collator.  Different player versions
return different orders per some Unicode standard that changes from time to time.

Modified:
    incubator/flex/sdk/branches/develop/mustella/tests/spark/collections/Sort/SWFs/newComps/BaseDataComp.mxml

Modified: incubator/flex/sdk/branches/develop/mustella/tests/spark/collections/Sort/SWFs/newComps/BaseDataComp.mxml
URL: http://svn.apache.org/viewvc/incubator/flex/sdk/branches/develop/mustella/tests/spark/collections/Sort/SWFs/newComps/BaseDataComp.mxml?rev=1389214&r1=1389213&r2=1389214&view=diff
==============================================================================
--- incubator/flex/sdk/branches/develop/mustella/tests/spark/collections/Sort/SWFs/newComps/BaseDataComp.mxml
(original)
+++ incubator/flex/sdk/branches/develop/mustella/tests/spark/collections/Sort/SWFs/newComps/BaseDataComp.mxml
Mon Sep 24 05:50:35 2012
@@ -19,12 +19,50 @@
 -->
 <s:Group xmlns:fx="http://ns.adobe.com/mxml/2009" 
 		 xmlns:s="library://ns.adobe.com/flex/spark" 
-		 xmlns:mx="library://ns.adobe.com/flex/mx" >
+		 xmlns:mx="library://ns.adobe.com/flex/mx"
+		 initialize="setFrenchOrder()" >
 	<fx:Script>
 		<![CDATA[
 			import mx.collections.ArrayCollection;
 			import mx.collections.ArrayList;
 			import mx.collections.IList; 
+			import flash.globalization.*;
+			
+			private var frenchWords:Array = [
+				'fr côté', 
+				'fr côte', 
+				'fr coté', 
+				'fr cöte'
+			];
+			
+			private var frenchMap:Object = {
+				"fr côte": "Izzy",
+				"fr coté": "TJ",
+				"fr cöte": "barmen",
+				"fr côté": "Bo"
+			}
+			
+			public function setFrenchOrder():void
+			{
+				var sortingCollator:Collator = new Collator("fr-FR", CollatorMode.SORTING);
+				frenchWords.sort(sortingCollator.compare);
+				var final:Array = [];
+				for each (var s:String in frenchWords)
+				{
+					final.push(frenchMap[s]);
+				}
+				
+				sortByAgeAddressFrArr[6] = final[0];
+				sortByAgeAddressFrArr[7] = final[1];
+				sortByAgeAddressFrArr[8] = final[2];
+				sortByAgeAddressFrArr[9] = final[3];
+				
+				sortByAgeAddressNumFrTrdArr[11] = final[0];
+				sortByAgeAddressNumFrTrdArr[12] = final[1];
+				sortByAgeAddressNumFrTrdArr[13] = final[2];
+				sortByAgeAddressNumFrTrdArr[14] = final[3];
+				
+			}
 			
 			//Add some simple array data for testing when sort.filed is null
 			public var mySimpleStrArr:ArrayList = new  ArrayList([null,'A',null,'A','a','a1','a','B','C','D','E','F','G','H','I','J','K',
@@ -131,10 +169,10 @@ for example, cote < côte < coté < 
 				'Matisse', 
 				'Molly', 
 				'Moe', 
-				'TJ',
 				'Izzy', 
-				'Bo', 
 				'barmen', 
+				'TJ',
+				'Bo', 
 				'Chumley', 
 				'Ted', 
 				'cadbury', 
@@ -172,10 +210,10 @@ for example, cote < côte < coté < 
 				'Matisse', 
 				'Molly', 
 				'Moe', 
-				'TJ', 
 				'Izzy', 
-				'Bo', 
 				'barmen', 
+				'TJ', 
+				'Bo', 
 			]);
 			
 			public var sortByIsTrueNameSwArr:ArrayCollection = new ArrayCollection([



Mime
View raw message