From 4620e7e96728bdc8bcd416961f0928a4780427c4 Mon Sep 17 00:00:00 2001 From: "mkaply%us.ibm.com" Date: Mon, 26 Nov 2001 21:04:19 +0000 Subject: [PATCH] No bug - Os/2 support for print preview --- gfx/src/os2/nsDeviceContextOS2.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/gfx/src/os2/nsDeviceContextOS2.cpp b/gfx/src/os2/nsDeviceContextOS2.cpp index 2550af20a824..f996cfcc111a 100644 --- a/gfx/src/os2/nsDeviceContextOS2.cpp +++ b/gfx/src/os2/nsDeviceContextOS2.cpp @@ -295,6 +295,12 @@ nsDeviceContextOS2 :: FindScreen ( nsIScreen** outScreen ) // Create a rendering context against our hdc for a printer nsresult nsDeviceContextOS2::CreateRenderingContext( nsIRenderingContext *&aContext) { +#ifdef NS_PRINT_PREVIEW + // Defer to Alt when there is one + if (mAltDC && (mUseAltDC & kUseAltDCFor_CREATE_RC)) + return mAltDC->CreateRenderingContext(aContext); +#endif + NS_ASSERTION( mPrintDC, "CreateRenderingContext for non-print DC"); nsIRenderingContext *pContext = new nsRenderingContextOS2; @@ -757,6 +763,12 @@ NS_IMETHODIMP nsDeviceContextOS2 :: ConvertPixel(nscolor aColor, PRUint32 & aPix NS_IMETHODIMP nsDeviceContextOS2 :: GetDeviceSurfaceDimensions(PRInt32 &aWidth, PRInt32 &aHeight) { +#ifdef NS_PRINT_PREVIEW + // Defer to Alt when there is one + if (mAltDC && (mUseAltDC & kUseAltDCFor_SURFACE_DIM)) + return mAltDC->GetDeviceSurfaceDimensions(aWidth, aHeight); +#endif + if ( mSpec ) { // we have a printer device