diff options
author | rsun3 <rsun3@6f19259b-4bc3-4df7-8a09-765794883524> | 2009-05-26 03:48:50 +0000 |
---|---|---|
committer | rsun3 <rsun3@6f19259b-4bc3-4df7-8a09-765794883524> | 2009-05-26 03:48:50 +0000 |
commit | f324bf4dbeda4d64b769bd005331e8f9404b692d (patch) | |
tree | 2f595bc48d40f5d1a706d64e6797e926a554409e /EdkCompatibilityPkg/Compatibility | |
parent | b0a5e682d632f139e8b4bd6a642aa15e0518a5c1 (diff) | |
download | edk2-f324bf4dbeda4d64b769bd005331e8f9404b692d.tar.gz edk2-f324bf4dbeda4d64b769bd005331e8f9404b692d.tar.bz2 edk2-f324bf4dbeda4d64b769bd005331e8f9404b692d.zip |
Roll back changes to apply GetBestLanguage() in HiiDataBase. Exact language match should be used in HiiDatabase.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8384 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'EdkCompatibilityPkg/Compatibility')
-rw-r--r-- | EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/Strings.c | 99 |
1 files changed, 44 insertions, 55 deletions
diff --git a/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/Strings.c b/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/Strings.c index d0b356be51..d83750bc9b 100644 --- a/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/Strings.c +++ b/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/Strings.c @@ -307,7 +307,6 @@ HiiThunkGetString ( Private = HII_THUNK_PRIVATE_DATA_FROM_THIS(This);
- Iso639AsciiLanguage = NULL;
Rfc4646AsciiLanguage = NULL;
if (LanguageString != NULL) {
@@ -322,6 +321,7 @@ HiiThunkGetString ( // in Iso639. So map it to the Language Identifier defined in RFC4646.
//
Rfc4646AsciiLanguage = ConvertLanguagesIso639ToRfc4646 (Iso639AsciiLanguage);
+ FreePool (Iso639AsciiLanguage);
//
// If Rfc4646AsciiLanguage is NULL, more language mapping must be added to
@@ -337,67 +337,56 @@ HiiThunkGetString ( goto Done;
}
- if (Rfc4646AsciiLanguage == NULL) {
- //
- // Get the languages that the package specified by HiiHandle supports
- //
- SupportedLanguages = HiiGetSupportedLanguages (UefiHiiHandle);
- if (SupportedLanguages == NULL) {
- goto Error2;
- }
+ //
+ // Get the languages that the package specified by HiiHandle supports
+ //
+ SupportedLanguages = HiiGetSupportedLanguages (UefiHiiHandle);
+ if (SupportedLanguages == NULL) {
+ goto Error2;
+ }
- //
- // Get the current platform language setting
- //
- PlatformLanguage = GetEfiGlobalVariable (L"PlatformLang");
- if (PlatformLanguage == NULL) {
- goto Error1;
- }
+ //
+ // Get the current platform language setting
+ //
+ PlatformLanguage = GetEfiGlobalVariable (L"PlatformLang");
+ if (PlatformLanguage == NULL) {
+ goto Error1;
+ }
- //
- // Get the best matching language from SupportedLanguages
- //
- BestLanguage = GetBestLanguage (
- SupportedLanguages,
- FALSE, // RFC 4646 mode
- PlatformLanguage, // Next highest priority
- SupportedLanguages, // Lowest priority
- NULL
- );
- if (BestLanguage == NULL) {
- FreePool (PlatformLanguage);
+ //
+ // Get the best matching language from SupportedLanguages
+ //
+ BestLanguage = GetBestLanguage (
+ SupportedLanguages,
+ FALSE, // RFC 4646 mode
+ (Rfc4646AsciiLanguage != NULL) ? Rfc4646AsciiLanguage : "",
+ PlatformLanguage, // Next highest priority
+ SupportedLanguages, // Lowest priority
+ NULL
+ );
+ if (BestLanguage == NULL) {
+ FreePool (PlatformLanguage);
Error1:
- FreePool (SupportedLanguages);
+ FreePool (SupportedLanguages);
Error2:
- Status = EFI_INVALID_PARAMETER;
- goto Done;
- }
-
- Status = mHiiStringProtocol->GetString (
- mHiiStringProtocol,
- BestLanguage,
- UefiHiiHandle,
- Token,
- StringBuffer,
- BufferLengthTemp,
- NULL
- );
- FreePool (BestLanguage);
- } else {
- Status = mHiiStringProtocol->GetString (
- mHiiStringProtocol,
- Rfc4646AsciiLanguage,
- UefiHiiHandle,
- Token,
- StringBuffer,
- BufferLengthTemp,
- NULL
- );
+ Status = EFI_INVALID_PARAMETER;
+ goto Done;
}
+ Status = mHiiStringProtocol->GetString (
+ mHiiStringProtocol,
+ BestLanguage,
+ UefiHiiHandle,
+ Token,
+ StringBuffer,
+ BufferLengthTemp,
+ NULL
+ );
+ FreePool (BestLanguage);
+
Done:
- if (Iso639AsciiLanguage != NULL) {
- FreePool (Iso639AsciiLanguage);
+ if (Rfc4646AsciiLanguage != NULL) {
+ FreePool (Rfc4646AsciiLanguage);
}
return Status;
|