r=jkobal, a=blizzard
Using wrong or bad PS to query font availability
This commit is contained in:
mkaply%us.ibm.com 2000-12-08 15:38:10 +00:00
Родитель fa1c717fe1
Коммит b34c43f641
1 изменённых файлов: 10 добавлений и 7 удалений

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

@ -116,10 +116,7 @@ nsresult nsDeviceContextOS2::Init( nsNativeWidget aWidget)
{
nsresult retval = DeviceContextImpl::Init(aWidget);
HWND hwnd = (HWND)aWidget;
HDC hdc = WinOpenWindowDC(hwnd);
CommonInit(hdc);
CommonInit(WinOpenWindowDC((HWND)aWidget));
return retval;
}
@ -607,10 +604,15 @@ nsresult nsDeviceContextOS2::GetDrawingSurface( nsIRenderingContext &aContext, n
NS_IMETHODIMP nsDeviceContextOS2 :: CheckFontExistence(const nsString& aFontName)
{
HWND hwnd = (HWND)mWidget;
HPS hps = ::WinGetPS(hwnd);
HPS hps = NULL;
PRBool isthere = PR_FALSE;
if (NULL != mPrintDC){
hps = mPrintPS;
} else {
hps = ::WinGetPS((HWND)mWidget);
}
char fontName[FACESIZE];
aFontName.ToCString( fontName, FACESIZE);
@ -618,7 +620,8 @@ NS_IMETHODIMP nsDeviceContextOS2 :: CheckFontExistence(const nsString& aFontName
long lFonts = GpiQueryFonts( hps, QF_PUBLIC | QF_PRIVATE,
fontName, &lWant, 0, 0);
::WinReleasePS(hps);
if (NULL == mPrintDC)
::WinReleasePS(hps);
if (lFonts > 0)
return NS_OK;