Bug 126231

We didn't want to change the contract between gfx and FontPackageProxy.
but we moved the call fontEnum->HaveFontFor(aFontPackID, &have) from /gfx to /intl/locale
We need to strip the "lang:" from aFontPackID.
/r=ftang;/sr=brendan
This commit is contained in:
yokoyama%netscape.com 2002-02-19 01:48:15 +00:00
parent 1a13143b79
commit 16e87c415e

View File

@ -109,7 +109,11 @@ nsresult nsFontPackageService::CallDownload(const char *aFontPackID, PRInt8 aInS
nsCOMPtr<nsIFontEnumerator> fontEnum = do_GetService("@mozilla.org/gfx/fontenumerator;1", &rv);
if (NS_SUCCEEDED(rv)) {
PRBool have = PR_FALSE;
rv = fontEnum->HaveFontFor(aFontPackID, &have);
// aFontPackID="lang:xxxx", strip "lang:" and get the actual langID
NS_ASSERTION((strncmp(aFontPackID, "lang:", 5) == 0), "Invalid FontPackID format.");
const char *langID = &aFontPackID[5];
rv = fontEnum->HaveFontFor(langID, &have);
if (NS_SUCCEEDED(rv)) {
if (!have) {
*aOutState = eDownload;