]> git.proxmox.com Git - mirror_edk2.git/commitdiff
This patch fix date/time op-code shows abnormal.
authorEric Dong <eric.dong@intel.com>
Tue, 7 Jan 2014 08:07:47 +0000 (08:07 +0000)
committerydong10 <ydong10@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 7 Jan 2014 08:07:47 +0000 (08:07 +0000)
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15055 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Universal/DisplayEngineDxe/FormDisplay.c

index 7130dffdc3091863f506ac8d967b1ee025750e68..5dfc482f3d0bb2a62beb06ea87e022947d79b714 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
 Entry and initialization module for the browser.\r
 \r
-Copyright (c) 2007 - 2013, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>\r
 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
@@ -1720,6 +1720,7 @@ HasOptionString (
   @param  SkipLine                 The skip line for this menu. \r
   @param  BottomRow                The bottom row for this form.\r
   @param  Highlight                Whether this menu will be highlight.\r
+  @param  UpdateCol                Whether need to update the column info for Date/Time.\r
 \r
   @retval EFI_SUCESSS              Process the user selection success.\r
 \r
@@ -1731,7 +1732,8 @@ DisplayOneMenu (
   IN UINTN                           BeginCol,\r
   IN UINTN                           SkipLine,\r
   IN UINTN                           BottomRow,\r
-  IN BOOLEAN                         Highlight\r
+  IN BOOLEAN                         Highlight,\r
+  IN BOOLEAN                         UpdateCol\r
   )\r
 {\r
   FORM_DISPLAY_ENGINE_STATEMENT   *Statement;\r
@@ -1780,7 +1782,7 @@ DisplayOneMenu (
       //\r
       // Adjust option string for date/time opcode.\r
       //\r
-      ProcessStringForDateTime(MenuOption, OptionString, TRUE);\r
+      ProcessStringForDateTime(MenuOption, OptionString, UpdateCol);\r
     }\r
   \r
     Width       = (UINT16) gOptionBlockWidth - 1;\r
@@ -1805,8 +1807,9 @@ DisplayOneMenu (
           } else {\r
             //\r
             // For date/ time, print the first and second past (year for date and second for time)\r
-            //                \r
-            DisplayMenuString (MenuOption, MenuOption->OptCol, Row, OutputString, StrLen (OutputString), Highlight);\r
+            // The OutputString has a NARROW_CHAR or WIDE_CHAR at the begin of the string, \r
+            // so need to - 1 to remove it, otherwise, it will clean 1 extr char follow it.\r
+            DisplayMenuString (MenuOption, MenuOption->OptCol, Row, OutputString, StrLen (OutputString) - 1, Highlight);\r
           }\r
         } else {\r
           DisplayMenuString (MenuOption, MenuOption->OptCol, Row, OutputString, Width + 1, Highlight);\r
@@ -2167,7 +2170,8 @@ UiDisplayMenu (
                             gStatementDimensions.LeftColumn + gModalSkipColumn, \r
                             Link == TopOfScreen ? SkipValue : 0, \r
                             BottomRow,\r
-                            (BOOLEAN) ((Link == NewPos) && IsSelectable(MenuOption))\r
+                            (BOOLEAN) ((Link == NewPos) && IsSelectable(MenuOption)),\r
+                            TRUE\r
                             );\r
           } else {\r
             Status = DisplayOneMenu (MenuOption, \r
@@ -2175,8 +2179,9 @@ UiDisplayMenu (
                             gStatementDimensions.LeftColumn, \r
                             Link == TopOfScreen ? SkipValue : 0, \r
                             BottomRow,\r
-                            (BOOLEAN) ((Link == NewPos) && IsSelectable(MenuOption))\r
-                            );         \r
+                            (BOOLEAN) ((Link == NewPos) && IsSelectable(MenuOption)),\r
+                            TRUE\r
+                            );\r
           }\r
 \r
           if (EFI_ERROR (Status)) {\r
@@ -2279,6 +2284,7 @@ UiDisplayMenu (
                           gStatementDimensions.LeftColumn, \r
                           Temp, \r
                           BottomRow,\r
+                          FALSE,\r
                           FALSE\r
                           );\r
         }\r
@@ -2300,7 +2306,8 @@ UiDisplayMenu (
                         gStatementDimensions.LeftColumn, \r
                         Temp2, \r
                         BottomRow,\r
-                        TRUE\r
+                        TRUE,\r
+                        FALSE\r
                         );\r
       }\r
       break;\r
@@ -2782,16 +2789,16 @@ UiDisplayMenu (
       NewLine     = TRUE;\r
 \r
       SavedListEntry = NewPos;\r
-\r
       ASSERT(NewPos != NULL);\r
+\r
+      MenuOption = MENU_OPTION_FROM_LINK (NewPos);\r
+      ASSERT (MenuOption != NULL);\r
+\r
       //\r
       // Adjust Date/Time position before we advance forward.\r
       //\r
       AdjustDateAndTimePosition (TRUE, &NewPos);\r
 \r
-      MenuOption = MENU_OPTION_FROM_LINK (NewPos);\r
-      ASSERT (MenuOption != NULL);\r
-\r
       NewPos     = NewPos->BackLink;\r
       //\r
       // Find next selectable menu or the first menu beyond current form.\r