if (!have && !hit && (lang1 == lang2)) { hit = PR_TRUE; if (!check) { nsFontEnumeratorWin enumerator; if (NS_SUCCEEDED(enumerator.HaveFontFor(lang3, &have))) check = PR_TRUE; } if (!have) { nsresult res = NS_OK; nsCOMPtr<nsIFontPackageProxy> proxy = do_GetService("@mozilla.org/intl/fontpackageservice;1", &res); NS_ASSERTION(NS_SUCCEEDED(res), "cannot get the font package proxy"); NS_ASSERTION(proxy, "cannot get the font package proxy"); if (proxy) { char fontpackageid[256]; PR_snprintf(fontpackageid, sizeof(fontpackageid), "lang:%s", lang3); res = proxy->NeedFontPackage(fontpackageid); NS_ASSERTION(NS_SUCCEEDED(res), "cannot notify missing font package "); } }
if (lang1 == lang2) { nsresult res = NS_OK; if (!gFontPackageProxy) { res = nsServiceManager::GetService("@mozilla.org/intl/fontpackageservice;1", NS_GET_IID(nsIFontPackageProxy), (nsISupports**) &gFontPackageProxy); if (NS_FAILED(res)) { NS_ERROR("Cannot get the font package proxy"); return; } }  char fontpackageid[256]; PR_snprintf(fontpackageid, sizeof(fontpackageid), "lang:%s", lang3); res = gFontPackageProxy->NeedFontPackage(fontpackageid); NS_ASSERTION(NS_SUCCEEDED(res), "cannot notify missing font package ");
CheckFontLangGroup(     nsIAtom* lang1, nsIAtom* lang2, const char* lang3, PRBool& hit,     PRBool& check, PRBool& have){  if (!have && !hit && (lang1 == lang2)) {     hit = PR_TRUE; // so next time we don't bother to ask     if (!check) {       nsFontEnumeratorWin enumerator;       if (NS_SUCCEEDED(enumerator.HaveFontFor(lang3, &have)))         check = PR_TRUE; // so next time we don't bother to check.     }     if (!have) {       nsresult res = NS_OK;       nsCOMPtr<nsIFontPackageProxy> proxy = do_GetService("@mozilla.org/intl/fontpackageservice;1", &res);       NS_ASSERTION(NS_SUCCEEDED(res), "cannot get the font package proxy");       NS_ASSERTION(proxy, "cannot get the font package proxy");       if (proxy) {         char fontpackageid[256];         PR_snprintf(fontpackageid, sizeof(fontpackageid), "lang:%s", lang3);         res = proxy->NeedFontPackage(fontpackageid);         NS_ASSERTION(NS_SUCCEEDED(res), "cannot notify missing font package ");       }     }  }}