flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aha...@apache.org
Subject git commit: [flex-sdk] [refs/heads/develop] - Need more tolerant name compare for assets swfs
Date Wed, 12 Jun 2013 19:57:19 GMT
Updated Branches:
  refs/heads/develop 287996211 -> 89084658d


Need more tolerant name compare for assets swfs


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

Branch: refs/heads/develop
Commit: 89084658ddeb241df2f1ef320c7ca1d39239d5d6
Parents: 2879962
Author: Alex Harui <aharui@adobe.com>
Authored: Wed Jun 12 12:56:19 2013 -0700
Committer: Alex Harui <aharui@adobe.com>
Committed: Wed Jun 12 12:56:19 2013 -0700

----------------------------------------------------------------------
 mustella/as3/src/mustella/CompareBitmap.as | 20 ++++++++++++++++++--
 1 file changed, 18 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/89084658/mustella/as3/src/mustella/CompareBitmap.as
----------------------------------------------------------------------
diff --git a/mustella/as3/src/mustella/CompareBitmap.as b/mustella/as3/src/mustella/CompareBitmap.as
index bb3aa2e..d80841c 100644
--- a/mustella/as3/src/mustella/CompareBitmap.as
+++ b/mustella/as3/src/mustella/CompareBitmap.as
@@ -1389,7 +1389,7 @@ public class CompareBitmap extends Assert
         var d:int;
         
         c = a.length;
-        for (var i:int = c - 1;i > 0; i--)
+        for (var i:int = c - 1;i >= 0; i--)
         {
             var ch:String = a.charAt(i);
             if ((ch >= '0' && ch <= '9') || ch == '_')
@@ -1467,7 +1467,7 @@ public class CompareBitmap extends Assert
                 // inconsistent behavior around StaticText   
                 return false;
             }
-            else
+            else if (!oneMoreNameCompare(sn, tn))
             {
                 trace("tag name mismatch: cur=", sn, "xml=", tn);
                 retval = true;
@@ -1575,6 +1575,22 @@ public class CompareBitmap extends Assert
         return retval;
     }
 
+	private function oneMoreNameCompare(a:String, b:String):Boolean
+	{
+		var aParts:Array = a.split("_");
+		var bParts:Array = b.split("_");
+		var i:int;
+		var n:int;
+		n = aParts.length;
+		for (i = 0; i < n; i++)
+			aParts[i] = trimName(aParts[i]);
+		n = bParts.length;
+		for (i = 0; i < n; i++)
+			bParts[i] = trimName(bParts[i]);
+		a = aParts.join("_");
+		b = bParts.join("_");
+		return a == b;
+	}
 }
 
 }


Mime
View raw message