diff options
author | qhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524> | 2007-02-28 07:41:28 +0000 |
---|---|---|
committer | qhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524> | 2007-02-28 07:41:28 +0000 |
commit | fad1794ce87433dd806fb1c354462093ce8b64fd (patch) | |
tree | 6315720b00518dc17fd7965b23646dc53e256bee /EdkModulePkg/Universal/UserInterface | |
parent | 2c33bcb4f2bfe2e85d4f6b246b26c96cf971c318 (diff) | |
download | edk2-platforms-fad1794ce87433dd806fb1c354462093ce8b64fd.tar.xz |
1. Fix an issue about the calculation of GlyphBufferSize
2. Fix a bug in handling the overlapped case by reverse-copying the destine region & source region
3. Fix an issue that the leading spaces could not be displayed in highlight mode
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2410 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'EdkModulePkg/Universal/UserInterface')
-rw-r--r-- | EdkModulePkg/Universal/UserInterface/HiiDataBase/Dxe/Strings.c | 55 | ||||
-rw-r--r-- | EdkModulePkg/Universal/UserInterface/SetupBrowser/Dxe/Ui.c | 91 |
2 files changed, 68 insertions, 78 deletions
diff --git a/EdkModulePkg/Universal/UserInterface/HiiDataBase/Dxe/Strings.c b/EdkModulePkg/Universal/UserInterface/HiiDataBase/Dxe/Strings.c index 26f797e63b..0dbcd33884 100644 --- a/EdkModulePkg/Universal/UserInterface/HiiDataBase/Dxe/Strings.c +++ b/EdkModulePkg/Universal/UserInterface/HiiDataBase/Dxe/Strings.c @@ -1,6 +1,6 @@ /*++
-Copyright (c) 2006, Intel Corporation
+Copyright (c) 2006 - 2007, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -60,45 +60,44 @@ Returns: {
EFI_HII_GLOBAL_DATA *GlobalData;
EFI_HII_DATA *HiiData;
- UINTN Count;
- BOOLEAN Narrow;
- UINTN Location;
- UINT8 GlyphCol1[19];
+ BOOLEAN WideChar;
+ INT32 Location;
if (This == NULL) {
return EFI_INVALID_PARAMETER;
}
HiiData = EFI_HII_DATA_FROM_THIS (This);
-
GlobalData = HiiData->GlobalData;
- Count = 0;
- Narrow = TRUE;
- ZeroMem (GlyphCol1, sizeof (GlyphCol1));
+
+ //
+ // Rewind through the string looking for a glyph width identifier
+ // If no width identifier exists, we assume string has narrow width identifier
+ //
+ for (WideChar = FALSE, Location = (INT32) *FirstMissing; Location >= 0; Location--) {
+ if ((StringToTest[Location] == NARROW_CHAR) || (StringToTest[Location] == WIDE_CHAR)) {
+ //
+ // We found something that identifies what glyph database to look in
+ //
+ WideChar = (BOOLEAN) (StringToTest[Location] == WIDE_CHAR);
+ break;
+ }
+ }
//
// Walk through the string until you hit the null terminator
//
- for (; StringToTest[*FirstMissing] != 0x00; (*FirstMissing)++) {
- Location = *FirstMissing;
+ for (*GlyphBufferSize = 0; StringToTest[*FirstMissing] != CHAR_NULL; (*FirstMissing)++) {
//
- // Rewind through the string looking for a glyph width identifier
+ // We found something that identifies what glyph database to look in
//
- for (; Location != 0; Location--) {
- if (StringToTest[Location] == NARROW_CHAR || StringToTest[Location] == WIDE_CHAR) {
- //
- // We found something that identifies what glyph database to look in
- //
- if (StringToTest[Location] == WIDE_CHAR) {
- Narrow = FALSE;
- } else {
- Narrow = TRUE;
- }
- }
+ if ((StringToTest[*FirstMissing] == NARROW_CHAR) || (StringToTest[*FirstMissing] == WIDE_CHAR)) {
+ WideChar = (BOOLEAN) (StringToTest[*FirstMissing] == WIDE_CHAR);
+ continue;
}
- if (Narrow) {
+ if (!WideChar) {
if (CompareMem (
GlobalData->NarrowGlyphs[StringToTest[*FirstMissing]].GlyphCol1,
&mUnknownGlyph,
@@ -127,13 +126,7 @@ Returns: }
}
- Count++;
- }
-
- if (Narrow) {
- *GlyphBufferSize = (UINT32) (Count * sizeof (EFI_NARROW_GLYPH));
- } else {
- *GlyphBufferSize = (UINT32) (Count * sizeof (EFI_WIDE_GLYPH));
+ *GlyphBufferSize += (WideChar ? sizeof (EFI_WIDE_GLYPH) : sizeof (EFI_NARROW_GLYPH));
}
return EFI_SUCCESS;
diff --git a/EdkModulePkg/Universal/UserInterface/SetupBrowser/Dxe/Ui.c b/EdkModulePkg/Universal/UserInterface/SetupBrowser/Dxe/Ui.c index 854d023f8e..5e09c5e2eb 100644 --- a/EdkModulePkg/Universal/UserInterface/SetupBrowser/Dxe/Ui.c +++ b/EdkModulePkg/Universal/UserInterface/SetupBrowser/Dxe/Ui.c @@ -1,6 +1,6 @@ /*++
-Copyright (c) 2006, Intel Corporation
+Copyright (c) 2006 - 2007, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -1295,7 +1295,6 @@ UpdateOptionSkipLines ( )
{
UINTN Index;
- UINTN Loop;
UINT16 Width;
UINTN Row;
UINTN OriginalRow;
@@ -1309,19 +1308,6 @@ UpdateOptionSkipLines ( ProcessOptions (MenuOption, FALSE, FileFormTagsHead, PageData, &OptionString);
if (OptionString != NULL) {
- //
- // If leading spaces on OptionString - remove the spaces
- //
- for (Index = 0; OptionString[Index] == L' '; Index++)
- ;
-
- for (Loop = 0; OptionString[Index] != CHAR_NULL; Index++) {
- OptionString[Loop] = OptionString[Index];
- Loop++;
- }
-
- OptionString[Loop] = CHAR_NULL;
-
Width = (UINT16) gOptionBlockWidth;
OriginalRow = Row;
@@ -1623,19 +1609,23 @@ Returns: ProcessOptions (MenuOption, FALSE, FileFormTagsHead, PageData, &OptionString);
if (OptionString != NULL) {
- //
- // If leading spaces on OptionString - remove the spaces
- //
- for (Index = 0; OptionString[Index] == L' '; Index++) {
- MenuOption->OptCol++;
- }
+ if (MenuOption->ThisTag->Operand == EFI_IFR_DATE_OP ||
+ MenuOption->ThisTag->Operand == EFI_IFR_TIME_OP
+ ) {
+ //
+ // If leading spaces on OptionString - remove the spaces
+ //
+ for (Index = 0; OptionString[Index] == L' '; Index++) {
+ MenuOption->OptCol++;
+ }
- for (Count = 0; OptionString[Index] != CHAR_NULL; Index++) {
- OptionString[Count] = OptionString[Index];
- Count++;
- }
+ for (Count = 0; OptionString[Index] != CHAR_NULL; Index++) {
+ OptionString[Count] = OptionString[Index];
+ Count++;
+ }
- OptionString[Count] = CHAR_NULL;
+ OptionString[Count] = CHAR_NULL;
+ }
//
// If this is a date or time op-code and is used to reflect an RTC, register the op-code
@@ -1835,18 +1825,22 @@ Returns: ProcessOptions (MenuOption, FALSE, FileFormTagsHead, PageData, &OptionString);
gST->ConOut->SetAttribute (gST->ConOut, FIELD_TEXT | FIELD_BACKGROUND);
if (OptionString != NULL) {
- //
- // If leading spaces on OptionString - remove the spaces
- //
- for (Index = 0; OptionString[Index] == L' '; Index++)
- ;
+ if (MenuOption->ThisTag->Operand == EFI_IFR_DATE_OP ||
+ MenuOption->ThisTag->Operand == EFI_IFR_TIME_OP
+ ) {
+ //
+ // If leading spaces on OptionString - remove the spaces
+ //
+ for (Index = 0; OptionString[Index] == L' '; Index++)
+ ;
- for (Count = 0; OptionString[Index] != CHAR_NULL; Index++) {
- OptionString[Count] = OptionString[Index];
- Count++;
- }
+ for (Count = 0; OptionString[Index] != CHAR_NULL; Index++) {
+ OptionString[Count] = OptionString[Index];
+ Count++;
+ }
- OptionString[Count] = CHAR_NULL;
+ OptionString[Count] = CHAR_NULL;
+ }
Width = (UINT16) gOptionBlockWidth;
@@ -1953,19 +1947,22 @@ Returns: if (SubMenu) {
ProcessOptions (MenuOption, FALSE, FileFormTagsHead, PageData, &OptionString);
if (OptionString != NULL) {
- //
- // If leading spaces on OptionString - remove the spaces
- //
- for (Index = 0; OptionString[Index] == L' '; Index++)
- ;
-
- for (Count = 0; OptionString[Index] != CHAR_NULL; Index++) {
- OptionString[Count] = OptionString[Index];
- Count++;
- }
+ if (MenuOption->ThisTag->Operand == EFI_IFR_DATE_OP ||
+ MenuOption->ThisTag->Operand == EFI_IFR_TIME_OP
+ ) {
+ //
+ // If leading spaces on OptionString - remove the spaces
+ //
+ for (Index = 0; OptionString[Index] == L' '; Index++)
+ ;
- OptionString[Count] = CHAR_NULL;
+ for (Count = 0; OptionString[Index] != CHAR_NULL; Index++) {
+ OptionString[Count] = OptionString[Index];
+ Count++;
+ }
+ OptionString[Count] = CHAR_NULL;
+ }
Width = (UINT16) gOptionBlockWidth;
OriginalRow = MenuOption->Row;
|