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

This commit is contained in:
pchen%netscape.com 2001-11-18 08:00:14 +00:00
Родитель 2f2def6297
Коммит 0136bcc918
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;