if (metrics->mFontsCount == metrics->mFontsAlloc) { int newSize = 2 * (metrics->mFontsAlloc ? metrics->mFontsAlloc : 1); nsString* newPointer = new nsString[newSize]; if (newPointer) { for (int i = metrics->mFontsCount - 1; i >= 0; i--) { newPointer[i].Assign(metrics->mFonts[i].GetUnicode()); } delete [] metrics->mFonts; metrics->mFonts = newPointer; metrics->mFontsAlloc = newSize; } else { return PR_FALSE; } } metrics->mFonts[metrics->mFontsCount++].Assign(aFamily.GetUnicode());
metrics->mFonts.AppendString(aFamily); metrics->mFontIsGeneric.AppendElement((void*) aGeneric);
FontEnumCallback(const nsString& aFamily, PRBool aGeneric, void *aData){  nsFontMetricsWin* metrics = (nsFontMetricsWin*) aData;  if (metrics->mFontsCount == metrics->mFontsAlloc) {    int newSize = 2 * (metrics->mFontsAlloc ? metrics->mFontsAlloc : 1);    nsString* newPointer = new nsString[newSize];    if (newPointer) {      for (int i = metrics->mFontsCount - 1; i >= 0; i--) {        newPointer[i].Assign(metrics->mFonts[i].GetUnicode());      }      delete [] metrics->mFonts;      metrics->mFonts = newPointer;      metrics->mFontsAlloc = newSize;    }    else {      return PR_FALSE; // stop    }  }  metrics->mFonts[metrics->mFontsCount++].Assign(aFamily.GetUnicode());  if (aGeneric) {    return PR_FALSE; // stop  }  return PR_TRUE; // don't stop}