]> git.proxmox.com Git - mirror_edk2.git/blobdiff - EdkModulePkg/Universal/UserInterface/SetupBrowser/Dxe/Ui.c
1. Fix an issue about the calculation of GlyphBufferSize
[mirror_edk2.git] / EdkModulePkg / Universal / UserInterface / SetupBrowser / Dxe / Ui.c
index 854d023f8e4a29b2a2e946a6219b2cea88fbd852..5e09c5e2eb324944c8a4fc6cb634300b7bfe87c5 100644 (file)
@@ -1,6 +1,6 @@
 /*++\r
 \r
-Copyright (c) 2006, Intel Corporation                                                         \r
+Copyright (c) 2006 - 2007, Intel Corporation                                                         \r
 All rights reserved. This program and the accompanying materials                          \r
 are licensed and made available under the terms and conditions of the BSD License         \r
 which accompanies this distribution.  The full text of the license may be found at        \r
@@ -1295,7 +1295,6 @@ UpdateOptionSkipLines (
   )\r
 {\r
   UINTN   Index;\r
-  UINTN   Loop;\r
   UINT16  Width;\r
   UINTN   Row;\r
   UINTN   OriginalRow;\r
@@ -1309,19 +1308,6 @@ UpdateOptionSkipLines (
   ProcessOptions (MenuOption, FALSE, FileFormTagsHead, PageData, &OptionString);\r
 \r
   if (OptionString != NULL) {\r
-    //\r
-    // If leading spaces on OptionString - remove the spaces\r
-    //\r
-    for (Index = 0; OptionString[Index] == L' '; Index++)\r
-    ;\r
-\r
-    for (Loop = 0; OptionString[Index] != CHAR_NULL; Index++) {\r
-      OptionString[Loop] = OptionString[Index];\r
-      Loop++;\r
-    }\r
-\r
-    OptionString[Loop]  = CHAR_NULL;\r
-\r
     Width               = (UINT16) gOptionBlockWidth;\r
 \r
     OriginalRow         = Row;\r
@@ -1623,19 +1609,23 @@ Returns:
             ProcessOptions (MenuOption, FALSE, FileFormTagsHead, PageData, &OptionString);\r
 \r
             if (OptionString != NULL) {\r
-              //\r
-              // If leading spaces on OptionString - remove the spaces\r
-              //\r
-              for (Index = 0; OptionString[Index] == L' '; Index++) {\r
-                MenuOption->OptCol++;\r
-              }\r
+              if (MenuOption->ThisTag->Operand == EFI_IFR_DATE_OP ||\r
+                  MenuOption->ThisTag->Operand == EFI_IFR_TIME_OP\r
+                  ) {\r
+                //\r
+                // If leading spaces on OptionString - remove the spaces\r
+                //\r
+                for (Index = 0; OptionString[Index] == L' '; Index++) {\r
+                  MenuOption->OptCol++;\r
+                }\r
 \r
-              for (Count = 0; OptionString[Index] != CHAR_NULL; Index++) {\r
-                OptionString[Count] = OptionString[Index];\r
-                Count++;\r
-              }\r
+                for (Count = 0; OptionString[Index] != CHAR_NULL; Index++) {\r
+                  OptionString[Count] = OptionString[Index];\r
+                  Count++;\r
+                }\r
 \r
-              OptionString[Count] = CHAR_NULL;\r
+                OptionString[Count] = CHAR_NULL;\r
+              }\r
 \r
               //\r
               // If this is a date or time op-code and is used to reflect an RTC, register the op-code\r
@@ -1835,18 +1825,22 @@ Returns:
           ProcessOptions (MenuOption, FALSE, FileFormTagsHead, PageData, &OptionString);\r
           gST->ConOut->SetAttribute (gST->ConOut, FIELD_TEXT | FIELD_BACKGROUND);\r
           if (OptionString != NULL) {\r
-            //\r
-            // If leading spaces on OptionString - remove the spaces\r
-            //\r
-            for (Index = 0; OptionString[Index] == L' '; Index++)\r
-              ;\r
+            if (MenuOption->ThisTag->Operand == EFI_IFR_DATE_OP ||\r
+                MenuOption->ThisTag->Operand == EFI_IFR_TIME_OP\r
+                ) {\r
+              //\r
+              // If leading spaces on OptionString - remove the spaces\r
+              //\r
+              for (Index = 0; OptionString[Index] == L' '; Index++)\r
+                ;\r
 \r
-            for (Count = 0; OptionString[Index] != CHAR_NULL; Index++) {\r
-              OptionString[Count] = OptionString[Index];\r
-              Count++;\r
-            }\r
+              for (Count = 0; OptionString[Index] != CHAR_NULL; Index++) {\r
+                OptionString[Count] = OptionString[Index];\r
+                Count++;\r
+              }\r
 \r
-            OptionString[Count] = CHAR_NULL;\r
+              OptionString[Count] = CHAR_NULL;\r
+            }\r
 \r
             Width               = (UINT16) gOptionBlockWidth;\r
 \r
@@ -1953,19 +1947,22 @@ Returns:
         if (SubMenu) {\r
           ProcessOptions (MenuOption, FALSE, FileFormTagsHead, PageData, &OptionString);\r
           if (OptionString != NULL) {\r
-            //\r
-            // If leading spaces on OptionString - remove the spaces\r
-            //\r
-            for (Index = 0; OptionString[Index] == L' '; Index++)\r
-              ;\r
-\r
-            for (Count = 0; OptionString[Index] != CHAR_NULL; Index++) {\r
-              OptionString[Count] = OptionString[Index];\r
-              Count++;\r
-            }\r
+            if (MenuOption->ThisTag->Operand == EFI_IFR_DATE_OP ||\r
+                MenuOption->ThisTag->Operand == EFI_IFR_TIME_OP\r
+                ) {\r
+              //\r
+              // If leading spaces on OptionString - remove the spaces\r
+              //\r
+              for (Index = 0; OptionString[Index] == L' '; Index++)\r
+                ;\r
 \r
-            OptionString[Count] = CHAR_NULL;\r
+              for (Count = 0; OptionString[Index] != CHAR_NULL; Index++) {\r
+                OptionString[Count] = OptionString[Index];\r
+                Count++;\r
+              }\r
 \r
+              OptionString[Count] = CHAR_NULL;\r
+            }\r
             Width               = (UINT16) gOptionBlockWidth;\r
 \r
             OriginalRow         = MenuOption->Row;\r