don't create a temp duplicate font list every time we need to get a font.... bug 329199. r=bz

This commit is contained in:
pavlov%pavlov.net 2006-03-03 05:54:47 +00:00
Родитель e86dd357ac
Коммит 0abecc5523
2 изменённых файлов: 9 добавлений и 4 удалений

Просмотреть файл

@ -117,7 +117,7 @@ nsThebesFontMetrics::Destroy()
gfxFont::Metrics nsThebesFontMetrics::GetMetrics()
{
return mFontGroup->GetFontList()[0]->GetMetrics();
return mFontGroup->GetFontAt(0)->GetMetrics();
}
NS_IMETHODIMP

Просмотреть файл

@ -160,7 +160,6 @@ protected:
const gfxFontStyle *mStyle;
};
typedef nsTArray< nsRefPtr<gfxFont> > gfxFontVector;
class NS_EXPORT gfxFontGroup {
public:
@ -170,7 +169,13 @@ public:
mFonts.Clear();
}
gfxFontVector GetFontList() { return mFonts; }
gfxFont *GetFontAt(PRInt32 i) {
return NS_STATIC_CAST(gfxFont*, mFonts[i]);
}
PRUint32 FontListLength() const {
return mFonts.Length();
}
const gfxFontStyle *GetStyle() const { return &mStyle; }
/* unicode method */
@ -189,7 +194,7 @@ protected:
nsString mFamilies;
gfxFontStyle mStyle;
gfxFontVector mFonts;
nsTArray< nsRefPtr<gfxFont> > mFonts;
};