bug 20943, r=rods, sr=ben, need to use alternate dc for print preview

This commit is contained in:
pchen%netscape.com 2006-02-10 22:49:11 +00:00
Родитель 074ac3b52d
Коммит 38a8b06f21
1 изменённых файлов: 14 добавлений и 0 удалений

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

@ -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;