From 35c218d7e6d542bb770858719676431b79ca1244 Mon Sep 17 00:00:00 2001 From: eric_tian Date: Wed, 3 Jun 2009 01:43:47 +0000 Subject: [PATCH] fix the HiiStrIdToImage sct failure, which is caused by wrong algorithm of finding right-most line break opportunity. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8446 6f19259b-4bc3-4df7-8a09-765794883524 --- MdeModulePkg/Universal/HiiDatabaseDxe/Font.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/MdeModulePkg/Universal/HiiDatabaseDxe/Font.c b/MdeModulePkg/Universal/HiiDatabaseDxe/Font.c index 4bb72c81d4..2fd355029d 100644 --- a/MdeModulePkg/Universal/HiiDatabaseDxe/Font.c +++ b/MdeModulePkg/Universal/HiiDatabaseDxe/Font.c @@ -1766,6 +1766,7 @@ HiiStringToImage ( // It forces a line break that ends this row. // Index++; + LineBreak = TRUE; break; } @@ -1842,6 +1843,12 @@ HiiStringToImage ( Index = Index1 + 1; break; } + // + // If don't find a line break opportunity from EndIndex to StartIndex, + // then jump out. + // + if (Index1 == RowInfo[RowIndex].StartIndex) + break; } } // @@ -1968,9 +1975,9 @@ HiiStringToImage ( Index++; RowIndex++; - if (Flags & EFI_HII_IGNORE_LINE_BREAK) { + if (!LineBreak) { // - // If setting IGNORE_LINE_BREAK attribute, only render one line to image + // If there is not a mandatory line break or line break opportunity, only render one line to image // break; }