use the baseclass members instead of declaring new ones. offshoot of 330510. r=vlad

git-svn-id: svn://10.0.0.236/trunk@192377 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
pavlov%pavlov.net
2006-03-14 23:18:42 +00:00
parent 975128bea0
commit 99bbaac40a
2 changed files with 7 additions and 13 deletions

View File

@@ -57,10 +57,6 @@ public:
PangoContext* GetPangoContext() { RealizeFont(); return mPangoCtx; }
protected:
nsString mName;
const gfxFontGroup *mFontGroup;
const gfxFontStyle *mFontStyle;
PangoFontDescription *mPangoFontDesc;
PangoContext *mPangoCtx;

View File

@@ -229,12 +229,10 @@ MOZ_pango_font_description_set_absolute_size(PangoFontDescription *desc, double
#endif
gfxPangoFont::gfxPangoFont(const nsAString &aName, const gfxFontGroup *aFontGroup)
: mName(aName), mFontGroup(aFontGroup)
: gfxFont(aName, aFontGroup)
{
InitPangoLib();
mFontStyle = mFontGroup->GetStyle();
mPangoFontDesc = nsnull;
mPangoCtx = nsnull;
mHasMetrics = PR_FALSE;
@@ -327,9 +325,9 @@ gfxPangoFont::RealizeFont(PRBool force)
mPangoFontDesc = pango_font_description_new();
pango_font_description_set_family(mPangoFontDesc, NS_ConvertUTF16toUTF8(mName).get());
MOZ_pango_font_description_set_absolute_size(mPangoFontDesc, mFontStyle->size * PANGO_SCALE);
pango_font_description_set_style(mPangoFontDesc, ThebesStyleToPangoStyle(mFontStyle));
pango_font_description_set_weight(mPangoFontDesc, ThebesStyleToPangoWeight(mFontStyle));
MOZ_pango_font_description_set_absolute_size(mPangoFontDesc, mStyle->size * PANGO_SCALE);
pango_font_description_set_style(mPangoFontDesc, ThebesStyleToPangoStyle(mStyle));
pango_font_description_set_weight(mPangoFontDesc, ThebesStyleToPangoWeight(mStyle));
#ifndef THEBES_USE_PANGO_CAIRO
mPangoCtx = pango_xft_get_context(GDK_DISPLAY(), 0);
@@ -338,8 +336,8 @@ gfxPangoFont::RealizeFont(PRBool force)
mPangoCtx = pango_cairo_font_map_create_context(PANGO_CAIRO_FONT_MAP(pango_cairo_font_map_get_default()));
#endif
if (!mFontStyle->langGroup.IsEmpty())
pango_context_set_language(mPangoCtx, GetPangoLanguage(mFontStyle->langGroup));
if (!mStyle->langGroup.IsEmpty())
pango_context_set_language(mPangoCtx, GetPangoLanguage(mStyle->langGroup));
pango_context_set_font_description(mPangoCtx, mPangoFontDesc);
@@ -492,7 +490,7 @@ gfxPangoFont::GetMetrics()
PangoFontMetrics *pfm = pango_font_get_metrics (font, NULL);
// ??
mMetrics.emHeight = mFontStyle->size;
mMetrics.emHeight = mStyle->size;
mMetrics.maxAscent = pango_font_metrics_get_ascent(pfm) / FLOAT_PANGO_SCALE;
mMetrics.maxDescent = pango_font_metrics_get_descent(pfm) / FLOAT_PANGO_SCALE;