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] - fix bug in xmldiffer
Date Fri, 07 Jun 2013 00:30:49 GMT
Updated Branches:
  refs/heads/develop f09029812 -> 72946c750


fix bug in xmldiffer


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

Branch: refs/heads/develop
Commit: 72946c750553dc6e69d72a3533756987beab0e46
Parents: f090298
Author: Alex Harui <aharui@apache.org>
Authored: Thu Jun 6 17:30:10 2013 -0700
Committer: Alex Harui <aharui@apache.org>
Committed: Thu Jun 6 17:30:10 2013 -0700

----------------------------------------------------------------------
 mustella/as3/src/mustella/CompareBitmap.as |   26 ++++++++++++++++++++--
 1 files changed, 23 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/72946c75/mustella/as3/src/mustella/CompareBitmap.as
----------------------------------------------------------------------
diff --git a/mustella/as3/src/mustella/CompareBitmap.as b/mustella/as3/src/mustella/CompareBitmap.as
index e609661..a67c1b3 100644
--- a/mustella/as3/src/mustella/CompareBitmap.as
+++ b/mustella/as3/src/mustella/CompareBitmap.as
@@ -1363,7 +1363,27 @@ public class CompareBitmap extends Assert
 		return a;
 	}
 	
-	// static text seems to float around a bit so ignore it.
+    // attempt to strip off random unique name chars for embedded assets
+    private function trimName(a:String):String
+    {
+        var c:int;
+        var d:int;
+        
+        c = a.length;
+        for (var i:int = c - 1;i > 0; i--)
+        {
+            var ch:String = a.charAt(i);
+            if ((ch >= '0' && ch <= '9') || ch == '_')
+            {
+                // assume it is a random char
+            }
+            else
+                break;
+        }
+        return a.substring(0, i + 1);
+    }
+
+    // static text seems to float around a bit so ignore it.
 	private function nullChildOrStaticText(a:String, b:String):Boolean
 	{
 		if (a.indexOf("<NullChild") != -1)
@@ -1414,10 +1434,10 @@ public class CompareBitmap extends Assert
         var tparts:Array = tn.split(".");
         n = sparts.length;
         for (i = 0; i < n; i++)
-            sparts[i] = trimTag(sparts[i]);
+            sparts[i] = trimName(sparts[i]);
         n = tparts.length;
         for (i = 0; i < n; i++)
-            tparts[i] = trimTag(tparts[i]);
+            tparts[i] = trimName(tparts[i]);
         sn = sparts.join(".");
         tn = tparts.join(".");
         if (tn != sn)


Mime
View raw message