]> git.proxmox.com Git - mirror_edk2.git/commitdiff
1. The old refresh string code also update the time/date opcode. But for the reason...
authorydong10 <ydong10@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 10 Mar 2011 02:28:15 +0000 (02:28 +0000)
committerydong10 <ydong10@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 10 Mar 2011 02:28:15 +0000 (02:28 +0000)
2. Also, the clean old string action used save attribute with paint string action which makes the background show abnormal.  Now using the normal attribute to clean the old string.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11359 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Universal/SetupBrowserDxe/Ui.c

index 05fcb7cc5da27d29bcbbdc35a14fa533c760344b..3ab63be2d61749f593c4ed8cf4e1acfc119f80f4 100644 (file)
@@ -342,7 +342,6 @@ RefreshForm (
   FORM_BROWSER_STATEMENT          *Question;\r
   EFI_HII_CONFIG_ACCESS_PROTOCOL  *ConfigAccess;\r
   EFI_BROWSER_ACTION_REQUEST      ActionRequest;\r
-  CHAR16                          *PadString;\r
 \r
   if (gMenuRefreshHead != NULL) {\r
 \r
@@ -354,8 +353,6 @@ RefreshForm (
     mHiiPackageListUpdated = FALSE;\r
 \r
     do {\r
-      gST->ConOut->SetAttribute (gST->ConOut, MenuRefreshEntry->CurrentAttribute);\r
-\r
       Selection = MenuRefreshEntry->Selection;\r
       Question = MenuRefreshEntry->MenuOption->ThisTag;\r
 \r
@@ -374,11 +371,22 @@ RefreshForm (
         for (Index = 0; OptionString[Index] == L' '; Index++)\r
           ;\r
 \r
-        PadString = AllocatePool (gOptionBlockWidth * sizeof (CHAR16));\r
-        SetMem16 (PadString, (gOptionBlockWidth - 1) * sizeof (CHAR16), CHAR_SPACE);\r
-        PadString[gOptionBlockWidth - 1] = 0;\r
-        PrintStringAt (MenuRefreshEntry->CurrentColumn, MenuRefreshEntry->CurrentRow, PadString);\r
-        FreePool (PadString);\r
+        //\r
+        // If old Text is longer than new string, need to clean the old string before paint the newer.\r
+        // This option is no need for time/date opcode, because time/data opcode has fixed string length.\r
+        //\r
+        if ((MenuRefreshEntry->MenuOption->ThisTag->Operand != EFI_IFR_DATE_OP) &&\r
+          (MenuRefreshEntry->MenuOption->ThisTag->Operand != EFI_IFR_TIME_OP)) {\r
+          ClearLines (\r
+            MenuRefreshEntry->CurrentColumn, \r
+            MenuRefreshEntry->CurrentColumn + gOptionBlockWidth - 1,\r
+            MenuRefreshEntry->CurrentRow,\r
+            MenuRefreshEntry->CurrentRow,\r
+            PcdGet8 (PcdBrowserFieldTextColor) | FIELD_BACKGROUND\r
+            );\r
+        }\r
+\r
+        gST->ConOut->SetAttribute (gST->ConOut, MenuRefreshEntry->CurrentAttribute);\r
         PrintStringAt (MenuRefreshEntry->CurrentColumn, MenuRefreshEntry->CurrentRow, &OptionString[Index]);\r
         FreePool (OptionString);\r
       }\r