Update AutoGen code to always create the same string token list got from uni file.
authorlgao4 <lgao4@c2973edb-eda0-4c78-bc6a-9341b269661f>
Tue, 2 Feb 2010 11:25:43 +0000 (11:25 +0000)
committerlgao4 <lgao4@c2973edb-eda0-4c78-bc6a-9341b269661f>
Tue, 2 Feb 2010 11:25:43 +0000 (11:25 +0000)
git-svn-id: https://edk2-buildtools.svn.sourceforge.net/svnroot/edk2-buildtools/trunk/BaseTools@1837 c2973edb-eda0-4c78-bc6a-9341b269661f

Source/Python/AutoGen/UniClassObject.py

index dcfa264..de2f93b 100644 (file)
@@ -406,18 +406,10 @@ class UniFileClassObject(object):
     #\r
     # Load multiple .uni files\r
     #\r
-    def LoadUniFiles(self, FileList = []):\r
+    def LoadUniFiles(self, FileList):\r
         if len(FileList) > 0:\r
-            if len(FileList) > 1:\r
-                NewList = [];\r
-                for File in FileList:\r
-                    NewList.append (File)\r
-                NewList.sort()\r
-                for File in NewList:\r
-                    self.LoadUniFile(File)\r
-            else:\r
-                for File in FileList:\r
-                    self.LoadUniFile(File)\r
+            for File in FileList:\r
+                self.LoadUniFile(File)\r
 \r
     #\r
     # Add a string to list\r
@@ -488,7 +480,6 @@ class UniFileClassObject(object):
                         EdkLogger.debug(EdkLogger.DEBUG_5, Name)\r
                         Token = len(self.OrderedStringList[LangFind])\r
                         self.AddStringToList(Name, LangFind, Value, Token, Referenced, LangKey, Index)\r
-\r
         #\r
         # Retoken\r
         #\r
@@ -497,7 +488,17 @@ class UniFileClassObject(object):
         ReferencedStringList = []\r
         NotReferencedStringList = []\r
         Token = 0\r
+\r
+        #\r
+        # Order UNI token by their String Name\r
+        #\r
+        StringNameList = []\r
         for Item in self.OrderedStringList[LangName]:\r
+            StringNameList.append (Item.StringName)\r
+        StringNameList.sort()\r
+\r
+        for Name in StringNameList:\r
+            Item = self.FindStringValue (Name, LangName)\r
             if Item.Referenced == True:\r
                 Item.Token = Token\r
                 ReferencedStringList.append(Item)\r