OS/2 bustage - nsFontMetricsOS2.cpp

This commit is contained in:
mkaply%us.ibm.com 2003-03-21 18:30:24 +00:00
Родитель 1a06c5b6b0
Коммит bd41102ee7
2 изменённых файлов: 15 добавлений и 14 удалений

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

@ -599,13 +599,13 @@ nsFontMetricsOS2::SetFontHandle( HPS aPS, nsFontOS2* aFont )
// Encoding: // Encoding:
// There doesn't seem to be any encoding stuff yet, so guess. // There doesn't seem to be any encoding stuff yet, so guess.
// (XXX unicode hack; use same codepage as converter!) // (XXX unicode hack; use same codepage as converter!)
nsCAutoString name; const char* langGroup;
mLangGroup->ToString(name); mLangGroup->GetUTF8String(&langGroup);
for (int j=0; j < eCharset_COUNT; j++ ) for (int j=0; j < eCharset_COUNT; j++ )
{ {
if (name.get()[0] == gCharsetInfo[j].mLangGroup[0]) if (langGroup[0] == gCharsetInfo[j].mLangGroup[0])
{ {
if (!strcmp(name.get(), gCharsetInfo[j].mLangGroup)) if (strcmp(langGroup, gCharsetInfo[j].mLangGroup) == 0)
{ {
mConvertCodePage = gCharsetInfo[j].mCodePage; mConvertCodePage = gCharsetInfo[j].mCodePage;
break; break;

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

@ -126,7 +126,7 @@ nsRenderingContextOS2::nsRenderingContextOS2()
mSurface = nsnull; mSurface = nsnull;
mPS = 0; mPS = 0;
mMainSurface = nsnull; mMainSurface = nsnull;
mColor = NS_RGB( 0, 0, 0); mColor = 0xffffffff;
mFontMetrics = nsnull; mFontMetrics = nsnull;
mLineStyle = nsLineStyle_kSolid; mLineStyle = nsLineStyle_kSolid;
mPreservedInitialClipRegion = PR_FALSE; mPreservedInitialClipRegion = PR_FALSE;
@ -134,10 +134,10 @@ nsRenderingContextOS2::nsRenderingContextOS2()
// Need to enforce setting color values for first time. Make cached values different from current ones. // Need to enforce setting color values for first time. Make cached values different from current ones.
mCurrFontMetrics = mFontMetrics + 1; mCurrFontMetrics = mFontMetrics + 1;
mCurrTextColor = mColor + 1; mCurrTextColor = 0xffffffff;
mCurrLineColor = mColor + 1; mCurrLineColor = 0xffffffff;
mCurrLineStyle = (nsLineStyle)((int)mLineStyle + 1); mCurrLineStyle = (nsLineStyle)((int)mLineStyle + 1);
mCurrFillColor = mColor + 1; mCurrFillColor = 0xffffffff;
mStateCache = new nsVoidArray(); mStateCache = new nsVoidArray();
mRightToLeftText = PR_FALSE; mRightToLeftText = PR_FALSE;
@ -293,10 +293,10 @@ nsresult nsRenderingContextOS2::SetupPS (void)
// Need to enforce setting color values for first time. Make cached values different from current ones. // Need to enforce setting color values for first time. Make cached values different from current ones.
mCurrFontMetrics = mFontMetrics + 1; mCurrFontMetrics = mFontMetrics + 1;
mCurrTextColor = mColor + 1; mCurrTextColor = 0xffffffff;
mCurrLineColor = mColor + 1; mCurrLineColor = 0xffffffff;
mCurrLineStyle = (nsLineStyle)((int)mLineStyle + 1); mCurrLineStyle = (nsLineStyle)((int)mLineStyle + 1);
mCurrFillColor = mColor + 1; mCurrFillColor = 0xffffffff;
return NS_OK; return NS_OK;
} }
@ -885,7 +885,7 @@ LONG nsRenderingContextOS2::GetGPIColor (void)
void nsRenderingContextOS2::SetupLineColorAndStyle (void) void nsRenderingContextOS2::SetupLineColorAndStyle (void)
{ {
if (mColor != mCurrLineColor) if ((mColor != mCurrLineColor) || (mCurrLineColor == 0xffffffff))
{ {
LINEBUNDLE lineBundle; LINEBUNDLE lineBundle;
lineBundle.lColor = GetGPIColor (); lineBundle.lColor = GetGPIColor ();
@ -915,7 +915,7 @@ void nsRenderingContextOS2::SetupLineColorAndStyle (void)
void nsRenderingContextOS2::SetupFillColor (void) void nsRenderingContextOS2::SetupFillColor (void)
{ {
if (mColor != mCurrFillColor) if ((mColor != mCurrFillColor) || (mCurrFillColor == 0xffffffff))
{ {
AREABUNDLE areaBundle; AREABUNDLE areaBundle;
areaBundle.lColor = GetGPIColor (); areaBundle.lColor = GetGPIColor ();
@ -2549,7 +2549,7 @@ void nsRenderingContextOS2::SetupFontAndColor (void)
} }
} }
if (mColor != mCurrTextColor) if ((mColor != mCurrTextColor) || (mCurrTextColor == 0xffffffff))
{ {
CHARBUNDLE cBundle; CHARBUNDLE cBundle;
cBundle.lColor = GetGPIColor (); cBundle.lColor = GetGPIColor ();
@ -2563,6 +2563,7 @@ void nsRenderingContextOS2::SetupFontAndColor (void)
mCurrTextColor = mColor; mCurrTextColor = mColor;
} }
} }
void nsRenderingContextOS2::PushClipState(void) void nsRenderingContextOS2::PushClipState(void)