From 0136bcc918d9528803c486cce8c2793eeb50b708 Mon Sep 17 00:00:00 2001 From: "pchen%netscape.com" Date: Sun, 18 Nov 2001 08:00:14 +0000 Subject: [PATCH] bug 20943, r=rods, sr=ben, need to use alternate dc for print preview --- gfx/src/mac/nsDeviceContextMac.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/gfx/src/mac/nsDeviceContextMac.cpp b/gfx/src/mac/nsDeviceContextMac.cpp index 4cc5beaaadb2..d4d0b72ab87d 100644 --- a/gfx/src/mac/nsDeviceContextMac.cpp +++ b/gfx/src/mac/nsDeviceContextMac.cpp @@ -123,6 +123,13 @@ NS_IMETHODIMP nsDeviceContextMac :: Init(nsNativeWidget aNativeWidget) */ NS_IMETHODIMP nsDeviceContextMac :: 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 + nsRenderingContextMac *pContext; nsresult rv; GrafPtr thePort; @@ -476,6 +483,13 @@ nsDeviceContextMac :: FindScreenForSurface ( nsIScreen** outScreen ) */ NS_IMETHODIMP nsDeviceContextMac::GetDeviceSurfaceDimensions(PRInt32 & outWidth, PRInt32 & outHeight) { +#ifdef NS_PRINT_PREVIEW + // Defer to Alt when there is one + if (mAltDC && (mUseAltDC & kUseAltDCFor_SURFACE_DIM)) { + return mAltDC->GetDeviceSurfaceDimensions(outWidth, outHeight); + } +#endif + if( mSpec ) { // we have a printer device outWidth = (mPageRect.right-mPageRect.left)*mDevUnitsToAppUnits;