From 84a31f8dabe23e482bb8c9be41b101ed65679f57 Mon Sep 17 00:00:00 2001 From: "mkaply%us.ibm.com" Date: Fri, 8 Dec 2000 15:38:10 +0000 Subject: [PATCH] #61253 r=jkobal, a=blizzard Using wrong or bad PS to query font availability git-svn-id: svn://10.0.0.236/trunk@83405 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/gfx/src/os2/nsDeviceContextOS2.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/mozilla/gfx/src/os2/nsDeviceContextOS2.cpp b/mozilla/gfx/src/os2/nsDeviceContextOS2.cpp index 2a2cadf083a..68bb78ba40a 100644 --- a/mozilla/gfx/src/os2/nsDeviceContextOS2.cpp +++ b/mozilla/gfx/src/os2/nsDeviceContextOS2.cpp @@ -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;